Wednesday, 15 April 2020

C++ Program - Area of Circle

Q: Write a program to calculate area of circle.
Solution:

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
 float r,area;
 cout<< "\nEnter radius of circle : ";
 cin>>r;
 area = 3.14*r*r;
 cout<<"Area of circle : "<<area;
 return 0;
}

Screenshot: 

No comments:

Post a Comment