c语言中循环控制语句;(do语句,用户输入决定循环次数)
1、
int main(void)
{
int j;
do
{
int i;
puts("please input an integer!");
printf("i = "); scanf("%d", &i);
if (i % 2)
puts("i is odd!");
else
puts("i is even!");
puts("choose continue or quit! j = 0: continue; j != 0: quit!");
printf("j = "); scanf("%d", &j);
}
while (j == 0); ## 次数语句判断非0则继续执行循环体
return 0;
}