Showing posts with label 1222 2122 2212 2221 dignal pyramid. Show all posts
Showing posts with label 1222 2122 2212 2221 dignal pyramid. Show all posts

5.15.2013

Alternate Number Pyramid

Q. Write a C program to print the following double number pyramid as:

1222
2122
2212
2221

Ans.

/*c program for alternate number pyramid*/
#include<stdio.h>
int main()
{
 int r,c,num=4;
 for(r=1; r<=num; r++)
 {
  for(c=1; c<=num; c++)