Write a program in c to find the area of circle and rectangle in one program using function
Answers
Answered by
6
Answer:
#include<stdio.h>
int main()
{
float radius, area;
printf("Enter Radius of Circle(in cm): ");
scanf("%f", &radius);
area = 3.14 * radius * radius;
printf("Area of Circle having radius %.2f cm= %.2f cm\n", radius,area);
return 0;
}
#include<stdio.h>
int main()
{
float len, wid, area;
printf("Enter length & width of Rectangle (in cm): ");
scanf("%f %f",&len,&wid);
area = len * wid;
printf("Area of Rectangle= %.3f cm\n",area);
return 0;
}
Explanation:
Similar questions
Hindi,
6 months ago
Math,
6 months ago
Math,
6 months ago
Computer Science,
1 year ago
Physics,
1 year ago