Area Of Square Example C++ Program


In classical times, the second power was described in terms of the area of a square, as in the above formula. This led to the use of the term square to mean raising to the second power. Thus the area of the square is twice the length of the square.

Area Of Square Formula

The area of a rectangle is written as,
s=side of the square

Area Of Square Example Program

/*## Area Of Square In C++*/
/*##Calculation C++ Programs, Datatype C++ Programs, Basic C++ Programs*/

#include <iostream>

using namespace std;

int main() {
   // Declare Variables
   float length, area;

   cout << "Simple C++ Program : Area Of Square\n";
   cout << "\nEnter the Length of Square : ";

   area = length * length;
   cout << "\nArea of Square : " << area;

   return (0);

Sample Output

Simple C++ Program : Area Of Square

Enter the Length of Square : 6

Area of Square : 36