write a program to input the two sides and check if it is a square or a rectangle
Answers
Answered by
5
PROGRAM
I have written a C++ program for your question. Kindly have a look over it.
#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
int x,y;
char choice;
A:
cout<<"Enter the value of two sides (integer type)."<<endl;
cin>>x>>y;
if(x==y)
{
cout<<"It is a square."<<endl;
}
else
{
cout<<"It is a rectangle."<<endl;
}
cout<<"Want to enter other two values ? (y/n)"<<endl;
cin>>choice;
if(choice=='y')
{
goto A;
}
if(choice=='n')
{
exit(0);
}
getch();
}
#answerwithquality #BAL
Similar questions