Answer to Question #35049 in C++ for jorgia

Question #35049
write a program that will accept the lenght of the side of square and print out its perimeter and area.
1
Expert's answer
2013-09-13T09:11:26-0400
#include <iostream>


using namespace std;


int main(){
float a, b;
//enter side
cout << "Enter the length of side (a, b) ";
cin >> a >> b;


//compute perimeter
cout << "Perimeter is " << (a + b) * 2 << "
";
//compute area
cout << "Area is " << a * b << "
";


return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS