You are on page 1of 4

1.

FINDING AREA AND


CIRCUMFERENCE OF THE
CIRCLE
AIM:

To write a program to find the area and


circumference of the circle.

ALGORITHM:

Step1: Start the program.

S t e p 2 : I n p u t   t h e   r a d i u s   o f   t h e 
circle.

Step3:Find the area and circumfere
n c e   o f   t h e   c i r c l e   u s i n g   t h e formula.
Area=3.14*r*r
Circumference=2*3.14*r

Step4:Print the area and the


circumference of the circle.
Step5:Stop the program.

PROGRAM:

#include<stdio.h>
main()
{
Floatrad,area,circum;
printf(“\nEnter the radius of the circle”);
scanf(“%f”,&rad);
area=3.14*rad*rad;
circum=2*3.14*rad;
printf(“\nArea=%f”,area);
printf(“\nCircumference=%f”,circum);
}

OUTPUT:

Enter the radius of the circle5Area=78.


500000Circumference=31.400000

RESULT:
The program is compiled,executed and verified
successfully.
2.FINDING EXPONENT
OF GIVEN NUMBER
AIM:

To write a Program to find the exponent of


the given number

 ALGORITHM:

S t e p 1 : S t a r t   t h e   p r o -
g r a m .
Step2:Enter the x value and 
n value.
S t e p 3 : S e t a l o o p u p t o
n .
Step4:Find the exponent valu
e   o f   x temp=temp*x/isum=sum+temp.

S t e p 5 : A ft e r t h e   e x e c u ti o n o f
the loop print the exponent value.

Step6:Stop the program.


PROGRAM:
#include<stdio.h>
main()
{
float x,temp=1,sum=1;
int i,no;
printf(“Enter the numbers”);
scanf(“%f%d”,&x,&no);
for(i=1;i<no;i++)
{
temp=temp*x/i;
sum=sum+temp;
}
printf(“Exponent of x is %f\n”,sum);
}
OUTPUT:
Enter the numbers
5
5
Exponent of x is 65.375000
Result:
The program is compiled,executed and verified
successfully.

You might also like