give the c++ prgram for following
Attachments:
Answers
Answered by
1
#include
#include
void main()
{
int i,j,row;
clrscr();
printf("\nHow many rows\n");
scanf("%d",&row);
for(i=1;i<=row;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Hope this will help you
#include
void main()
{
int i,j,row;
clrscr();
printf("\nHow many rows\n");
scanf("%d",&row);
for(i=1;i<=row;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Hope this will help you
Answered by
3
Hey dude ....
Here's ur answer...
.
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int i,j,rows;
cout<<"Enter the number of rows: ";
cin>>rows;
for(i=1;i<=rows;++i)
{
for(j=1;j<=i;++j)
{
cout<<j<<" ";
}
cout<<"\n";
}
getch();
}
Hope I helped you.
Here's ur answer...
.
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int i,j,rows;
cout<<"Enter the number of rows: ";
cin>>rows;
for(i=1;i<=rows;++i)
{
for(j=1;j<=i;++j)
{
cout<<j<<" ";
}
cout<<"\n";
}
getch();
}
Hope I helped you.
Similar questions