C++ Program :-
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
int num1,num2,num3=1;
for(num1=1;num1<=5;num1++)
{
cout<<endl;
for(num2=num3;num2<num3+10;num2++)
{
cout<<" "<<num2;
}
num3+=10;
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
int num1,num2,num3=1;
for(num1=1;num1<=5;num1++)
{
cout<<endl;
for(num2=num3;num2<num3+10;num2++)
{
cout<<" "<<num2;
}
num3+=10;
}
getch();
}
OUTPUT:-
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15..... 20
21..... ....................30
31...........................40
41...........................50
Write in comments if you have any questions about this program I will answer as early as possible.
ReplyDeleteYeh tO bhT Aasan PrOgram hai .. :P :P
ReplyDeletethen dats gud bro try advance level yar :-)
ReplyDeleteBRO plz tell me how to output that similar program using just 1 single FOR loop
ReplyDeletefor(n=1;n<=50;n++)
ReplyDelete{
printf("%d ",n);
if(n%10==0)
printf("\n");
}