New Want to Write for Computaholics ? if Yes Contact us at "contact@computaholics.in"

c program to print given number pattern

Write a c program to print given number pattern
1 2 3 4 5 6
2 1 2 3 4 5
3 2 1 2 3 4
4 3 2 1 2 3
5 4 3 2 1 2
6 5 4 3 2 1

#include<stdio.h>>
int main ()
{
  int i,m,n;
  for (i=1;i<=6;i++)
  {
    for(n=i;n>1;n--)
      printf("%d ",n);
    for(m=1;m<=7-i;m++)
      printf("%d ",m);
    printf("\n");
  }
}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics