#include < stdio.h >
int main()
{
int a=1;
while(a <= 10)
{
printf("%d", a);
a++;
if( a % 3 == 0 )
{
continue;
}
}
}
------------
10까지 3의배수 제외하고 출력하는 프로그램인디
실행결과
1부터10까지 다나오네요 뭐가 문제일까유??
#include < stdio.h >
int main()
{
int a=1;
while(a <= 10)
{
printf("%d", a);
a++;
if( a % 3 == 0 )
{
continue;
}
}
}
알려주십쇼 형님들,...
while(a <=10) { if (a % 3 != 0) printf("%d") a }
if문 위에다가 printf로 출력하니까 그렇잖아
if문을 먼저 써야 저게 처리가 될것임 니가 한건 먼저 출력을 한 후에 조건을 건거니까
감사합니다!