KR Code Corner
Friday, 22 May 2015
How to print numbers from 1-10 in while loop in c++
#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int i;
cout<<"Number from 1 to 10";
i=1;
while(i<=10)
{
cout<<"\n"<<i;
i++;
}
getch();
}
Coding Format
Output Format
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment