Answer to Question #17728 in C++ for mat

Question #17728
Respectd sir,
I want a programm to display the countdown.Below i hv written a program to print numbers from 10 to 0.I want it to be displayed in the count down format.
MODIFY THE BELOW PROGRAM IN THE COUNTDOWN FORMAT.
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=10;i<11;i--)
{
cout<<i;
}
getch();
}
1
Expert's answer
2012-11-01T12:22:01-0400

#include <conio.h>
#include <iostream>
using namespace std;

void main()
{
for(int i=10;i>=0;--i)
{
cout<<i<<endl;
_sleep(1000);
}
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS