recent

c program to print given number pattern

 Write a c program to print given number pattern
   1  2  3  4  5  6
   7  8  9 10 11
12 13 14 15
16 17 18
19 20
21

#include<stdio.h>
int main()
{
  int i,m,n;
  n=1;
  for(i=1;i<=6;i++)
  {
    for(m=6;m>=i;m--)
    {
        printf("%3d",n++);
    }
    printf("\n");
  }
}
Powered by Blogger.