Thursday 29 September 2016

pattern

 

pattern

 5          1
    4     2
       3
  4       2
5             1


#include<stdio.h>#include<conio.h>void main(){int n=5;int i,j;clrscr();for(i=n;i>=1;i--){for(j=n;j>=1;j--){if(i==j||i+j==n+1)printf(“%d”,j);elseprintf(“ “);}getch();} 

No comments:

Post a Comment