Program to calculate the area of square and area of circle. Input values for square and circle are same and display the result of square and circle.
#include<stdio.h>
void main(){
double area_of_square;
double area_of_circle;
int n;
printf("Input the value to calculate areas\n");
scanf("%d",&n);
area_of_square = n * n;
area_of_circle = (22 / 7 ) * n;
printf("The area of the square is\t %f\n",area_of_square );
printf("The area of the circle is\t %f",area_of_circle );
}
Comments
Leave a comment