C Program to Find LCM and GCD

/*C Program to Find LCM and GCD*/ #include<stdio.h> #include<conio.h> void main() { int n1,n2,a,b; printf(“\nEnter Two Numbers: “);  scanf(“%d %d”,&n1,&n2); a=n1;b=n2; while(n1!=n2) {     if(n1>n2)                       n1=n1-n2;     else                      n2=n2-n1; } printf(“\nLCM= %d”,(a*b)/n1); …

150,604 total views, 284 views today

Read More

C Program To Print Fibonacci Series

/*C Program To Print Fibonacci Series*/  #include<stdio.h> #include<conio.h> void main() { int n1=0,n2=1,count,n,fibo; clrscr(); printf(“\nEnter The Number of Fibonacci Series: “); scanf(“%d”,&n); if(n>=1)                 printf(“\n0”); if(n>=2)                printf(“\t1”); if(n>=3)          for(count=1;count<=n-2;count++)          {      …

30,545 total views, 36 views today

Read More

C Program To Print Tables

/*C Program To Print Tables*/ #include<stdio.h> #include<conio.h> void main() { int i,n; clrscr(); printf(“\nEnter The Number: “); scanf(“%d”,&n); for(i=1;i<=10;i++) {                printf(“\n%d * %d = %d”,n,i,n*i); } getch(); } 12,782 total views, 46 views today

12,782 total views, 46 views today

Read More

C Program To Find The Sum of Digits (Even and Odd) Of a Given Number

/*C Program To Find The Sum of Digits (Even and Odd) Of a Given Number */ #include<stdio.h> #include<conio.h> void main() { int n,even_sum=0,odd_sum=0,rem; printf(“\nEnter a number: “); scanf(“%d”,&n); while(n>0) {                    rem=n%10;        if(r%2==0)                    even_sum=even_sum+rem;  …

91,387 total views, 360 views today

Read More

C Program To Find The Sum and Average of Number Series Entered by the Use

/*C Program To Find The Sum and Average of Number Series Entered by the User*/ #include<stdio.h> #include<conio.h> void main() { int i,n; float x,sum=0,avg; printf(“\nHow Many Numbers Do You Wish To Add? “);  scanf(“%d”,&n); for(i=1;i<=n;i++) {                    printf(“\nEnter x: “);              …

107,001 total views, 165 views today

Read More

C Program to find the average of Natural Numbers

/*C Program to find the average of Natural Numbers*/  #include<stdio.h> #include<conio.h> void main() { int i=1,n; float sum=0; clrscr(); printf(“\nEnter The Number: “); scanf(“%d”,&n); while(i<=n) {           sum=sum+i;           i++; } printf(“\nSum =  %f”,sum); printf(“\nAvg = %f “,(sum/n)); } 12,334 total views, 110 views today

12,334 total views, 110 views today

Read More

C Program for Simple Calculator

/*C Program for Simple Calculator */ #include<stdio.h> #include<conio.h> void main() { int ur; float a,b; clrscr(); printf(“\n1. ADDITION\n 2. SUBTRACTION\n3. MULTIPLICATION\n4. DIVISION “); printf(“\n Enter User: “); scanf(“%d”,&ur); printf(“\nEnter Two Numbers: “); scanf(“%f%f”,&a,&b); switch(ur) { case 1:       printf(“\n\n%f + %f = %f”,a,b,a+b);       break; case 2:      printf(“\n\n%f –…

74,282 total views, 118 views today

Read More