C++ 编程 while 循环Create a while loop. Before the loop, ask the user to enter an integer. Go through the loop as many times as the number entered. Keep count of the number of times you’ve gone through the loop and print this number in the l

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 13:44:50

C++ 编程 while 循环Create a while loop. Before the loop, ask the user to enter an integer. Go through the loop as many times as the number entered. Keep count of the number of times you’ve gone through the loop and print this number in the l
C++ 编程 while 循环
Create a while loop. Before the loop, ask the user to enter an integer. Go through the loop as many times as the number entered. Keep count of the number of times you’ve gone through the loop and print this number in the loop.

C++ 编程 while 循环Create a while loop. Before the loop, ask the user to enter an integer. Go through the loop as many times as the number entered. Keep count of the number of times you’ve gone through the loop and print this number in the l
int num;
printf("Please enter a int : ");
scanf("%d",&num);
while(num>0)
{
printf("%d\n",num);
num--;
}