WAP to input two adjacent sides of a four sided figur.
Check and print using if-else whether it is a
Square or
a rectangleAnd accordingly calculate its area and
perimeter Also write variable description
Answers
Answered by
2
Answer:
// A simple program to find if given 4
// values can represent 4 sides of rectangle
#include <iostream>
using namespace std;
// Function to check if the given
// integers value make a rectangle
bool isRectangle(int a, int b, int c, int d)
{
// Square is also a rectangle
if (a == b == c == d)
return true;
else if (a == b && c == d)
return true;
else if (a == d && c == b)
return true;
else if (a == c && d == b)
return true;
else
return false;
}
Explanation:
please follow me
Similar questions
CBSE BOARD X,
3 months ago
English,
7 months ago
Math,
11 months ago
Political Science,
11 months ago