Showing posts with label 1 2*2 3*3*3 3*3*3 2*2 1*1 Alternate Number-Star pyramid. Show all posts
Showing posts with label 1 2*2 3*3*3 3*3*3 2*2 1*1 Alternate Number-Star pyramid. Show all posts

8.23.2013

Alternate Number-Star Pyramid

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);