Question No. 100 :
Write a C - program to find out the area and perimeter of a circle. The radius will be taken as input.
Answers
Hey there !
Solution:
Coding is as follows:
___________________________________________________________
#include <stdio.h>
#include <conio.h>
#define PI 3.141
int main(){
float radius, area;
printf("Enter radius of circle\n");
scanf("%f", &radius);
/* Area of Circle = PI x Radius X Radius */
area = PI*radius*radius;
printf("Area of circle : %0.4f\n", area);
getch();
return 0;
}
___________________________________________________________
For output check Attachment !
Hope my answer helped !
Answer:
Explanation:
#include<iostream.h>//header file declaration
#include<conio.h>
void main()
{
clrscr() //clear screen command
int r;double a,p; //declaration of variables
cout<<"Enter the radius:";
cin>>r;
a=3.14*r*r;
p=2*3.14*r;
cout<<"\nArea of circle:"<<a;
cout<<"\nPerimeter of circle:"<<p;
getch(); //get character command
}
Hope you understood