#include<stdio.h>
#include<conio.h>
int main()
{
int c=1;
int n;
printf("enter the number of rows you want \n");
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
printf("%4d",c);
c++;
}
printf(" \n");
}
getch();
return 0;
}
#include<conio.h>
int main()
{
int c=1;
int n;
printf("enter the number of rows you want \n");
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
printf("%4d",c);
c++;
}
printf(" \n");
}
getch();
return 0;
}
No comments:
Post a Comment