Write a C++ program to find the area of a shape whose area is given by the formula Area = 2+4r + πr^6
//importing the library
#include <iostream>
#include <math.h>
using namespace std;
int main() {
float r,Area=0; //initilization of the variable
cout<<"Enter the value of r : "<<endl;//taking input from the user
cin>>r;
Area = 2+4*r + 3.14*pow(r, 6); // calculating the area of the shape
cout<<"Area of the shape :"<<Area; //here you will get output of the program
return 0;
}
//end of the program
OUTPUT SCREEN IS :
value of r: 5
so,
Area : 49084.5
Get Answers For Free
Most questions answered within 1 hours.