Write a C-
program to compute the circumference of
a circle and area of circle.#Programming near me # java 8 download.
Consider a
c-program, which are use to find the circumference of a circle
and area of circle , and displays the result. Here the complete
programs are shown as follows……
1: Using
Define
#include<stdio.h>
#include<conio.h>
#define pi
3.14
Void main()
{
Float r,a,c;
Printf(“Enter the Radius \n”);
Scanf(“%f”,&r);
a=pi*r*r;
c=2*pi*r;
printf(“Area
of circle =%f \n”,a);
printf(“Circumference
of circle=%f \n”,c);
getch();
}
Input= 4
Output=
Area of
circle= 50.240002
Circumference
of circle=25.120001
Area and circumference of circle |
2:-Using constant
#include<stdio.h>
#include<conio.h>
Void main()
{
Const float
pi=3.14;
Float r,a,c;
Clrscr();
Printf(“Enter the Radius \n”);
Scanf(“%f”,&r);
a=pi*r*r;
c=2*pi*r;
printf(“area
of circle =%f \n”,a);
printf(“circumference
of circle=%f \n”,c);
getch();
}
Input= 4
Output=
Area of
circle= 50.240002
Circumference
of circle=25.120001
Area and circumferences of circle |
3:-Using Float
#include<stdio.h>
#include<conio.h>
Void main()
{
Float r,a,c,pi=3.14;
Clrscr();
Printf(“Enter the Radius \n”);
Scanf(“%f”,&r);
a=pi*r*r;
c=2*pi*r;
printf(“area
of circle =%f \n”,a);
printf(“circumference
of circle=%f \n”,c);
getch();
}
Input= 4
Output=
Area of
circle= 50.240002
Circumference
of circle=25.120001
output:-output |
@shiva
0 Comments