Write a C++ program to calculate area of circle.


Program Code:
#include<iostream>
using namespace std;
int main()
{
int radius;
float area;
cout<< " Enter radius of circle : ";
cin>>radius;
cout<<endl;
area = 3.14 * radius * radius;
cout<<"Area of circle is equal to : "<<area;
return 0;

}


The program code is tested on www.jdoodle.com
Output:
Enter radius of circle : 23
Area of circle is equal to : 1661.06

Thanks
Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: