ما هو الخطأ عند تشغيل البرنامج واختيار 1 ثم 1 ثم ادخال المعطيات يتم اعطاء الناتج وبجانبه خطا (جمله ELSE)
#include
using namespace std;
int main()
{
double length;
double width;
double area;
int intput;
float choice;
float perimeter;
cout <<“1-rectangle” << endl << “2-Square” << endl;
cout << “Enter a number…”;
cin >> intput;
if(intput ==1)
{cout << “What is the unknown?..” <<endl
<< “1-length” <<endl
<< "2-width "<< endl
<<“3-area” <<endl
<<“4-perimeter” << endl
<< “unknown is…”;
cin >> choice;}
if (choice == 1)
{ cout <<“What is the width?..”;
cin >> width;
cout << “what is the area?”;
cin >> area;
cout << “length =” << area / width;
}
if (choice == 2)
{ cout << "What is the length?..";
cin >> length;
cout << "What is the area?..";
cin >> area;
cout << "width =" << length / area;}
if (choice == 3)
{ cout << "What is the length?..";
cin >> length;
cout << "What is the width?..";
cin >> width;
cout << "area =" << length * width;}
if (choice == 4)
{ cout << "What is the length?..";
cin >> length;
cout << "What is the width?..";
cin >> width;
cout << "perimeter =" << 2 * (length + width);}
if (intput ==2)
{ cout <<"What is the unknown?.."<< endl
<<"1-Length of the side" << endl
<<"2-area" << endl
<<"3-perimeter" << endl;
cin >> choice;}
if (choice ==1)
{cout <<"What is the perimeter?..";
cin >> perimeter;
cout << "Length of the side =" <<perimeter / 4 ;}
if (choice ==2)
{cout <<"What is the Length of the side?..";
cin >> length;
cout << "area =" << length * length;}
if (choice ==3)
{cout <<"What is the Length of the side?..";
cin >> length;
cout << "perimeter ="<< length * 4;}
else {cout << "Error Please try again" ;}
return 0;
}