C program to print a pattern – Coding Question 4
Write a C program to print the following pattern(till n rows, where n is taken as input). #include<stdio.h> #include<math.h> int main() { int i,j,h,space,x=1; printf("n Enter the height: "); scanf("%d",&h); for(i=1;i<=h;i++) { printf("n"); for(space=1;space<=(h-i);space++) printf(" "); for(j=1;j<=i;j++) { printf("%d ",x); x=1-x; } } return 0; } Join Our Telegram Group Visit our Facebook Page Coding […]
C program to print a pattern – Coding Question 4 Read More »