This program is useful for C++ beginners. Sometimes they find logic to build different series. Here is
how to make a C++ program to generate natural numbers from 1 to 100 using for loop.
#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int i;
for (i=1;i<=100;i++)
{
cout<<i<<endl;
}
getch();
}
No comments:
Post a Comment