Answer to Question #211064 in C for genji

Question #211064

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.


1
Expert's answer
2021-07-01T04:00:14-0400
#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 );
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS