MS Rumi. Powered by Blogger.

Friday 25 April 2014

Loop in C++ 1 to 40 numbers

By Unknown  |  03:26 No comments

Nested For Loop In C++ 

Use for loop to print number (1 to 40)  5 on a line.

#include<iostream.h>
void main ()
{
int num=1;
for(int i=1; i<=8; i++)
{
for(int j=1; j<=5; j++)
{
cout<<num;
num++;
}
cout<<endl;
}

}


OutPut



Author: Unknown

Hello, I am Author, thanks for visiting my blog. Bookmark this....

0 comments:

E-mail Newsletter

Sign up now to receive breaking news and to hear what's new with us.

Recent Articles

TOP