CProgram

Find Area of Square & Circumference of a Circle

Write a C program to find the area of a square & circumference of a circle.

#include <stdio.h>
#define PI 3.142
main()
{
float len, r, area, circum;
printf(“\nEnter length of a square: “);
scanf(“%f”, &len);
area = len * len;
printf(“\nEnter radius of a circle: “);
scanf(“%f”, &r);
circum = 2 * PI * r;
printf(“\nArea of square = %.2f”, area);
printf(“\nCircumference of circle = %.2f”, circum);
getch();
}

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

You may also like

Leave a reply

Your email address will not be published. Required fields are marked *

More in:C