Output Following Code Assuming Circles 5 Circles Radius 3 5 35 12 012 Include Using Namesp Q37216500

What is the output of the following code assuming circles = 5,and circles radius are [3, 5, 3.5, 12, 0.12]

#include <iostream>
using namespace std;

int main() {

cout << “Enter the number of circles to calculate areafor: “;
cin >> circles;

for(int i=0; i< circles; i++){

float radius, area_circle;

cout << “Enter the radius of circle: “;
cin >> radius;

area_circle = 3.14 * radius * radius;
cout << “Area of circle number (“<<(i+1)<<“)”<< area_circle << endl;

}

return 0;
}


Answer


The given code has lots of errors,i’ll rectify it then outputthe code.

code:-

#include <iostream>
using namespace std;

int main()
{
int circles;//declaring number of circles.
cout << “Enter the number of circles to calculate area for:”;
cin >>

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.