/countdown
//codefree.mxatec.com
#include
void main()
{
int start;
long delay;
/* This loop ensures they type in the proper value */
do
{
printf("Please enter the number to start\n");
printf("the countdown (1 to 1000):");
scanf("%i",&start);
}
while(start<1 start="">1000);1>
/* The countdown loop */ //Example of a "nested loop"
do
{
printf("T-minus %i\n",start);
start--;
for(delay=0;delay<1000000 class="Apple-tab-span" delay="" span="" style="white-space: pre;"> 1000000>
//delay loop }//codefree.mxatec.com
#include
void main()
{
int start;
long delay;
/* This loop ensures they type in the proper value */
do
{
printf("Please enter the number to start\n");
printf("the countdown (1 to 1000):");
scanf("%i",&start);
}
while(start<1 start="">1000);1>
/* The countdown loop */ //Example of a "nested loop"
do
{
printf("T-minus %i\n",start);
start--;
for(delay=0;delay<1000000 class="Apple-tab-span" delay="" span="" style="white-space: pre;"> 1000000>
while(start>0);
printf("Zero!\nBlast off!\n");
system("pause");
}
Comentários
Postar um comentário