Code for pattern 7 Get link Facebook X Pinterest Email Other Apps Code for pattern 7 * *** ***** ******* #include<stdio.h> #include<conio.h> void main() { int i,j,k; for(i=1;i<=4;i++) { for(j=3;j>=i;j--) { printf(" "); } for(k=1;k<2*i;k++) { printf("*"); } printf("\n"); } getch(); } Output Get link Facebook X Pinterest Email Other Apps Comments
Code for pattern 1 Code for Pattern 1 *** *** *** #include<stdio.h> #include<conio.h> void main() { int i,j; for(i=1;i<=3;i++) { for(j=1;j<=3;j++) { printf("*"); } printf("\n"); } getch(); } Output Read more
Code for sum of 1 to 10 digits(Using for loop) Code for sum of 1 to 10 digits(Using for loop) #include<stdio.h> #include<conio.h> void main() { int i,s=0; for(i=1;i<=10;i++) { s=s+i; } printf("sum=%d",s); getch(); } Output Read more
Code to print even numbers between 1..........100(using for loop) Code to print even numbers between 1..........100(using for loop) #include<stdio.h> #include<conio.h> void main() { int i; for(i=1;i<=100;i++) { if(i%2==0) { printf("%d",i); } } getch(); } Output Read more
Comments
Post a Comment