C++ program to find the area of a square

In this article, you will learn a C++ program to find the area of a square. This program accepts the length of the square from the user. After computation, it displays an area of the square on the console screen.


Here is the formula to check the area of a square.

A = Side * Side

Example: Find the Area of the square in C++

#include <iostream>
using namespace std;

int main() 
   int area, side;

   cout << "Enter any side of the square: ";
   cin >> side;

   area = side * side;

   cout << "Area of the Square is: " << area << endl;
   return 0;


cpp program to find area of square

Recommended Articles

C++ student grade program

C++ program to print star patterns