In C++ program you can write a program to calculate the area of a square.
Let's look at the C++ Code to calculate the area of a square.
#include <iostream.h>
#include <iostream.h>
#include <conio.h>
using namespace std;
int main ()
{
float side, area ;
cout<<"Enter side of the square : " ;
cin >>side ;
cout<<"\n The area of the square is :" ;
cout<<side*side ;
cout<<"square-units" ;
return 0 ;
}
The Output of the C++ Code