- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

We are given with a side of a rectangle and our task is to print the area of the square from that side.

Square is 2-D plain figure which have 4 sides and forms 4 angles of 90degree each and all the sides are of equal shape. In other words we can say that the square is a form of rectangle with equal sides.

Given below is representation of a square −

The Area of square is Side x Side

Input: 6 Output: 36 As the side is 6 so the output is 6*6=36 Input: 12 Output: 144

START Step 1-> Declare a function int area(int side) In function area Declare a variable area and set it as side * side Return area End Step 2 -> Declare a function int main() In main Function Declare a variable side and Set a Value Call function area(side) End STOP

#include <iostream> using namespace std; //funcion to calculate area of square int area(int side){ int area = side * side; return area; } // Driver Code int main(){ int side = 40; cout <<"area of square is :"<<area(side); return 0; }

area of square is :1600

- Related Questions & Answers
- C++ Program for Area Of Square after N-th fold
- Area of a leaf inside a square in C Program?
- Java Program to Find Area of Square
- Program for Surface area of Dodecahedron in C++
- Program for Surface Area of Octahedron in C++
- C Program for Area of a square inscribed in a circle which is inscribed in a hexagon?
- Java program to find the area of a square
- Area of a square from diagonal length in C++
- Area of a Circumscribed Circle of a Square in C++
- C Program for Area And Perimeter Of Rectangle
- Program for Volume and Surface Area of Cube in C++
- Program for Volume and Surface Area of Cuboid in C++
- Area of a leaf inside a square?
- C Program for Program to find the area of a circle?
- Program to calculate the area of an Circle inscribed in a Square

Advertisements