0

Wap to show pattern

cba ba a

19th Apr 2018, 8:46 AM
mohd shahnawaz
mohd shahnawaz - avatar
1 Odpowiedź
0
/**************** Here is the required Code. I hope it will help You ******************************/ #include<stdio.h> int main() { char ch; int num; printf("Enter Number : "); scanf("%d",&num); printf("\nPattern is : \n"); for(int i=num;i>0;i--) { for(int j=num;j>i;j--) { printf(" "); } ch = 'a' + i -1; for(int j=i;j>0;j--) { printf("%c",ch--); } printf("\n"); } }
14th Apr 2020, 4:46 AM
Ashish Bernanee
Ashish Bernanee - avatar