Computer Science, asked by anshultanya, 5 months ago

Write a C++ program to find the area and perimeter of rectangle ( Formula A=l*b and P=2*(l+b)​

Answers

Answered by mrchauhan123rs
0

Question

1. ਵਿੰਡੋਜ਼ ਐਕਸਪਲੋਰਰ ਦੇ ਭਾਗਾਂ ਦੀ ਸੂਚੀ ਬਣਾਓ ।

Answered by Berseria
12

Structure of C++ Program :

// Comment line

#include <iostream>

using namespace std ;

int main ( )

{

........

Body of Program ;

............

return 0 ;

}

Required C++ Program :

#include <iostream>

using namespace std ;

int main ( )

{

float length , breadth , peri , area ;

cout << " Enter the length and breadth of rectangle : " ;

cin >> lenght >> breadth ;

Peri = 2 * ( length + breadth ) ;

Area = length * breadth ;

cout << "Perimeter = " <<peri << endl ;

cout << " Area = " <<area <<endl ;

return 0 ;

}

Output :

Enter the length and breadth of rectangle = 10 2

Perimeter = 24

Area = 20

Similar questions