How to write C++ Program to print first 10 natural numbers using while loop ?
C++ Print first 10 natural numbers using while loop. |
Solution:
//Program to print first 10 natural numbers using while loop.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=0;
while(a<10)
{
++a;
cout<<a<<endl;
}
getch();
}
This C++ Program to print first 10 natural numbers using while loop .