#include <stdio.h>
int cal_first(void)
{
    int k=0, p=0;
    do{
        p=p+k;
        k++;
    }while (k<10);
    return p;
}

int cal_scond(void)
{
    int k=1, p=0;
    while (k<10){
        p=p+k;
        k+=2;
    }
    return p;
}
int main(void) {
    int a=0, b=0, i, result;
    int M[5] = {2, 3, 5, 7};
    for (i=0; i<=3; ++i) a+=M[i]; //총합이 17
    b=a%4;                        //b의 값은 1
    if(b<2) result=cal_first();   //if 조건 만족으로 cal_firtst 실행
    else result=cal_scond();
    printf("%d\t %d\n", b, result);
    }

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: