By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

how Conversion 2 c++

P: 1
how Conversion area = π R 2 (area of a circle) 2 c++
Mar 14 '17 #1
Share this Question
Share on Google+
1 Reply


dev7060
100+
P: 117
Maybe you are asking how to convert this statement into code form. For this, the formula 'π rČ' can be written as area= 3.14*r*r.

Complete program for this:
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() 
  5. {
  6.  
  7.     float r, area;
  8.     cout<<"Enter radius of circle: ";
  9.     cin>>r;
  10.     area= 3.14*r*r;
  11.     cout<<"Area of circle is:"<<area;
  12.     return 0;
  13. }
  14.  
  15.  
Mar 14 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.