Code for pattern 6 Get link Facebook X Pinterest Email Other Apps Code for pattern 6 1 23 456 78910 #include<stdio.h> #include<conio.h> void main() { int i,j,l=1; for(i=1;i<=4;i++) { for(j=1;j<=i;j++) { printf("%d",l); l++; } 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 to find factorial(Using for loop) Code to find factorial(Using for loop) #include<stdio.h> #include<conio.h> void main() { int f=1,i,n; printf("Enter any number"); scanf("%d",&n); for(i=n;i>=1;i--) { f=f*i; } printf("Factorial=%d",f); 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