Jan 27, 2007

C++ Program to generate natural numbers from 1 to 100 using for loop

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

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive