Write a C++ program to find area of Square and Rectangle. - Pratik Ghelani

Pratik Ghelani

Breaking

Sunday, January 20, 2019

Write a C++ program to find area of Square and Rectangle.

Program:-


#include<iostream>
using namespace std;
 int main() 
{
 int a,b,area1,area2;
 cout<<"Enter the length:";
 cin>>a;
 cout<<"Enter the breadth:"; cin>>b; 
area1=a*a;
area2=a*b; 
cout<<"area of square is:"<<area1<<endl;
cout<<"area of Rectangle:"<<area2<<endl;
return 0;
 }

Output:-



No comments:

Post a Comment