Write a program in C to calculate the area and circumference ofcircles given the
ID: 3609736 • Letter: W
Question
Write a program in C to calculate the area and circumference ofcircles given their radii.The program should use a define statement to specify the maximumnumber of circles
and this value should be set at 10. The program should prompt theuser for the number of
circles to be entered. If the number entered is greater than themaximum number of
circles, the program should print an error message and prompt theuser to make another
selection.
The program should then proceed to read all of the radii and storethem in an array. Once
the radii are read in, the program should calculate the area andcircumference for each
circle and output the results in a tabular format.
The prompts and error messages have to look like this:
Please enter the number of circles (max = 10):
11
Error -> 11 circles is too many. Please try again:
4
You have selected to enter 4 circles.
Enter the radius for circle #1:
Enter the radius for circle #2:
Enter the radius for circle #3:
Enter the radius for circle #4:
Explanation / Answer
please rate - thanks #include #include #define MAX 10; int main() {int num=50,i; float pi=3.14159,area,per,radii[10]; while(num>10) {printf("Please enter the number ofcircles (max = 10): "); scanf("%d",&num); if(num>11) printf("Error-> %d circles is too many. Please try again: ",num); } printf("You have selected to enter %d circles. ",num); for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.