Q. Write a C program to print the following alternate number-star pyramid/triangle as:
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
Ans.
/*c program for alternate number-star pyramid*/
#include<stdio.h>
int main()
{
int num,r,c,z=1,p,n;
printf("Enter maximum number : ");
scanf("%d", &num);
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
Ans.
/*c program for alternate number-star pyramid*/
#include<stdio.h>
int main()
{
int num,r,c,z=1,p,n;
printf("Enter maximum number : ");
scanf("%d", &num);