Write individual program to print the following Pyramids:-
a)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,m;
clrscr();
scanf("%d",&m);
printf("\n\n\n");
for(a=1;a<=m;a++)
{
for(b=1;b<=a;b++)
printf("%d ",a);
printf("\n\n");
}
getch();
}
b)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,n=40,m;
clrscr();
scanf("%d",&m);
printf("\n\n\n");
for(a=1;a<=m;a++)
{
for(b=1;b<=n;b++)
printf(" ");
for(b=1;b<=a;b++)
printf("%d ",a);
printf("\n\n");
n=n-2;
}
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,m;
clrscr();
scanf("%d",&m);
printf("\n\n\n");
for(a=1;a<=m;a++)
{
for(b=1;b<=a;b++)
printf("%d ",a);
printf("\n\n");
}
getch();
}
b)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,n=40,m;
clrscr();
scanf("%d",&m);
printf("\n\n\n");
for(a=1;a<=m;a++)
{
for(b=1;b<=n;b++)
printf(" ");
for(b=1;b<=a;b++)
printf("%d ",a);
printf("\n\n");
n=n-2;
}
getch();
}