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/05/13 13:22:41
C++编程while循环Createawhileloop.Beforetheloop,asktheusertoenteraninteger.Gothroughtheloopasmanytimesast

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--;
}