Tech Study

C++ Program to Calculate Area of Square

Introduction

How to calculate area of square in c++. I have used Dev-C++ IDE for debugging purpose. But you can use any C programming language compiler as per your compiler availability.

#include<iostream>
#define PI 3.141
using namespace std;

int main()
{

  int side, area;

   cout << "Enter the Length of Side : ";
   cin >> side;
   
  // Formula to calculate area of square
   area = side * side;
   cout << "Area of Square : "<< area;
   
   return 0;
}

Result

C++ Program to Calculate Area of Square
C++ Program to Calculate Area of Square

To learn more about c++ viste these links ;

C++ program to calculate the total marks, percentage and division of student based on three subjects

TaggedC++ Program to Calculate Area of Square

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more