Thursday, December 24, 2009


/*Program to Find Area of a Circle*/
#include
#include
void main()
{
float r,area;
clrscr();
printf("Enter Radius of the Circle");
scanf("%f",&r);
area=(22*r*r)/7;
printf("Area of the Circle is = %f",area);
getch();
}
/*Program to Display Division*/
#include
#include
void main()
{
float per;
clrscr();
printf("Enter percentage");
scanf("%f",&per);
if(per<36)
printf("Fail");
else
if(per>=36 && per<48)
printf("III Division");
else
if(per>=48 && per<60)
printf("II Division");
else
printf("I Division");
getch();
}
/*Program to find whether the no is +ve or -ve*/
#include
#include
void main()
{
int num;
clrscr();
printf("Enter any number");
scanf("%d",&num);
if(num>0)
printf("Number is Positive");
else
printf("Number is Negative");
getch();
}
/*Program to Display whether the no is Odd or Even*/
#include
#include
void main()
{
int num;
clrscr();
printf("Enter any number");
scanf("%d",&num);
if(num%2==0)
printf("Number is Even");
else
printf("Number is Odd");
getch();
}

No comments:

Post a Comment