fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float length, breadth, area, perimeter;
  6.  
  7. cout << "Enter length and breadth of the rectangle: ";
  8. cin >> length >> breadth;
  9.  
  10. area = length * breadth;
  11. perimeter = 2 * (length + breadth);
  12.  
  13. cout << "Area of the rectangle = " << area << endl;
  14. cout << "Perimeter of the rectangle = " << perimeter;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5316KB
stdin
12 42
stdout
Enter length and breadth of the rectangle: Area of the rectangle = 504
Perimeter of the rectangle = 108