Area of Square Get link Facebook X Pinterest Email Other Apps Code for area of square #include<stdio.h> #include<conio.h> void main() { int a,s; printf("Enter side of square"); scanf("%d",&s); a=s*s; printf("Area=%d",a); 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