Prelab Exercise: In C++, how do you compute the side length of a square whose area is stored in the variable area? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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 Answers
+ 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