i/p: 3
o/p : 1
232
45654
c program
o/p : 1
232
45654
c program
#include<stdio.h> int main(){ int i,m,j,temp=0,n; scanf("%d",&n); for(i=1;i<=n;i++){
//to print space printf("%*s",(n-i),""); //to print increment order
for(j=1;j<=i;j++){ printf("%d",++temp); }
//to print decrement order for(j=1;j<i;j++) printf("%d",temp-j); printf("\n"); } return 0; }
Comments
Post a Comment