emilia98

Rectangle Area

Feb 5th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6.     double a,b;
  7.     double area,perimeter;
  8.     //cout<<"a = ";
  9.     cin>>a;
  10.     //cout<<"b = ";
  11.     cin>>b;
  12.     area = a*b;
  13.     perimeter = 2*(a+b);
  14.  
  15.     cout<<fixed<<setprecision(2)<<area<<" "<<perimeter<<endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment