- 1

Prelab Exercise: In C++, how do you compute the side length of a square whose area is stored in the variable area?

Variables: int length,area; The formula of square area length Don't forget to use the <cmath> stream.

7th Feb 2017, 5:07 PM
Zeyad Sharo
Zeyad Sharo - avatar
3 odpowiedzi
+ 2
#include <iostream> #include <math.h> using namespace std; int main(void){ float area, length; cout<<"Enter the area of a square: "; cin>>area; lenght = sqrt(area); cout<<"Lenght of the square = "<<length; return 0; }
13th Feb 2017, 4:29 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 2
Thanks buddy for appreciation
13th Feb 2017, 5:10 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
0
thank you
13th Feb 2017, 5:09 PM
Zeyad Sharo
Zeyad Sharo - avatar