Code of the program:
Code#2:
#include<iostream>
using namespace std;
int main() {
float
r,area;
const
float PI=3.14;
cout<<"Enter
number to find the area of the circle"<<endl;
cin>>r;
area
= PI*(r*r);
cout<<"area
of the circle is: "<<area;
return
0;
}
Output:Code#2:
#include<iostream>
using namespace std;
int main()
{
float
r,area;
const
float PI=3.14;
cout<<"Enter
the value to calculate the area of the cylender"<<endl;
cin>>r;
area
= 2*PI*r;
cout<<"Area
of cylender is = "<<area<<endl;
}
Output:
Good work
ReplyDelete