//greatest number among three numbers#include<stdio.h>void main(){int a,b,c, greatest;printf(“enter three numbers:”);scanf(“%d%d%d”,&a,&b,&c);if(a>b && a>c)greatest=a; …
C Program to Check Leap Year
//leap year #include<stdio.h> void main() { int year; printf(“enter the year\n”); scanf(“%d”,&year); if(year%100==0) { if(year%400==0) printf(“the year is leap\n”); else …
Switch Case Statement
//use of case statement #include<stdio.h> void main() { int choice, a,b,result; printf(“Enter the choice\n1.Add\n2.Substract\n3.Multiply\n4.Division\n “); scanf(“%d”,&choice); printf(“enter the two numbers”); …
C Program to Convert Decimal Number to Binary Number
#include<stdio.h> void main() { int r,n, sum=0,i=1; printf(“enter the value of n”); scanf(“%d”,&n); while(n!=0) { r=n%2; sum=sum+r*i; n=n/2; i*=10; } …
C Program to Convert Binary Number into Decimal Number.
#include<stdio.h> #include<math.h> void main() { int n, sum=0, p=0,r,num, rem,check; printf(“enter the value of n\n”); scanf(“%d”,&n); num=n; while(num!=0) …
Cosine Series ( cos(x)=1-x^2/2!+x^4/4!-x^6/6!+……………)
//c program to find the value of cosine series #include<stdio.h> #define pi 3.1416 void main() { int n,i; float x, …
sine series (sin(x)=x – x^3/3! +x^5/5!……..)
//c program to find the value of sine series #include<stdio.h> #define pi 3.1416 void main() { int n,i; float x, …
C Program to find factorial of an integer
//calculating factorial of number that is n!=n*(n-1)*(n-2)…..3*2*1 #include<stdio.h> void main() { int fact=1,n; printf(“enter the number”); scanf(“%d”,&n); while(n!=0) { fact=fact*n; …
C Program to Find the Area of a Circle
#include<stdio.h> void main() { float A,r; printf(“enter the radius of the circle “); scanf(“%f”,&r); A=3.14*r*r; printf(“\nthe area of the cirlce …
C Program to Dispaly 2-D Table
#include<stdio.h> void main() { int n,i,j; printf(“\n enter the number upto which multiplication is to be found\n”); scanf(“%d”,&n); for(j=1;j<=n;j++) { …
