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;
}
}
Hello, I am Author, thanks for visiting my blog. Bookmark this....
E-mail Newsletter
Sign up now to receive breaking news and to hear what's new with us.
0 comments: