السلام عليكم ورحمة الله وبركاتة
أواجة مشكلة فى الكود التالى عند إدخال مدخلات خاطئة فى المتغير char الذى يستقبل العملية المراد تنفيذها مثل الجمع أو الطرح تظهر تلك المشكلة الموجودة بالصورة لآنة من المفترض أن يتم سوأل المستخدم عن إعادة إختيار الدخول على الحاسبة أو الخروج من البرنامج أما الذى يحدث فإن البرنامج يقوم بإدخال إختيار الحاسبة لوحدة ثم يطبع خطأ فى إدخال أول رقم ثم يتوقف البرنامج ثانية منتظرا إختيار المستخدم للدخول على الحاسبة أو الخروج من البرنامج فما المشكلة وما الحل أسف على الإطالة

كود البرنامج بالاسفل
/*
Name: mohamed elhababshe
Copyright: rinGawy Team
Author: mohamed elhabashe
Date: 24/01/12 02:27
Description: simpel calculator
*/
#include <limits>
#include <cstdlib>
#include <iostream>
float a,b;
int e,f,c;
using namespace std;
void Errorinput(void)
{
cout<<"-------------------------"<<endl<<"Error Enter your number again"<<endl<<"-------------------------"<<endl;
}
void Errormethod(void)
{
cout<<"-------------------------"<<endl<<"Error"<<a<<"/0 Wrong method cannot divide by zero please correct your method"<<endl<<"-------------------------"<<endl;
}
void Erroroperathion(void)
{
cout<<"-------------------------"<<endl<<"Error please Enter your operathion again"<<endl<<"-------------------------"<<endl;
}
void Erroronumber(void)
{
cout<<"-------------------------"<<endl<<"Error number input number between 1 or 2 or 3"<<endl<<"-------------------------"<<endl;
}
int main()
{
char d;
do{
first:
cout<<"hello this main menu please Enter your choice number"<<endl<<"1-Enter calculating program"<<endl<<"2-information about me"<<endl<<"3-no thanks get me out of here"<<endl<<"=>>";
cin>>c;
if(cin.fail()==true)
{
cin.clear();
cin.ignore(std::numeric_limits<int>::max(),'\n');
Errorinput();
goto first;
}
else
switch(c)
{
case 1:{
cout<<"welcome to my simple calculator"<<endl<<"Enter frist number =";
cin>>a;
if(cin.fail()==true)
{
cin.clear();
cin.ignore(std::numeric_limits<int>::max(),'\n');
Errorinput();
goto first;
}
else
cout<<"Enter second number =";
cin>>b;
if(cin.fail()==true)
{
cin.clear();
cin.ignore(std::numeric_limits<int>::max(),'\n');
Errorinput();
goto first;
}
else
seconde:
cout<<"Enter your arithmetic operathion like ( + , - , * , / ,% ) =";
cin>>d;
if(cin.fail()==true)
{
cin.clear();
cin.ignore(std::numeric_limits<int>::max(),'\n');
Erroroperathion();
goto seconde;
}
else
switch(d)
{
case '+':cout<<"------------------"<<endl<<a<<"+"<<b<<"="<<a+b<<endl<<"------------------"<<endl;break;
case '-':cout<<"------------------"<<endl<<a<<"-"<<b<<"="<<a-b<<endl<<"------------------"<<endl;break;
case '*':cout<<"------------------"<<endl<<a<<"*"<<b<<"="<<a*b<<endl<<"------------------"<<endl;break;
case '/':{
if(b==0)
{
Errormethod();
goto first;
}
else
cout<<"------------------"<<endl<<a<<"/"<<b<<"="<<a/b<<endl<<"------------------"<<endl;break;
}
case '%':{
if(b==0)
{
Errormethod();
goto first;
}
else
e=(int)a;
f=(int)b;
cout<<"------------------"<<endl<<e<<"%"<<f<<"="<<e%f<<endl<<"------------------"<<endl;break;
}
default:Erroroperathion();
}
};break;
case 2:cout<<"---------------------------------"<<endl<<"my name: mohamed elhabashe"<<endl<<"my age: 25"<<endl<<"from: Egypt (country of fredoom)"<<endl<<"---------------------------------"<<endl;break;
case 3:cout<<"bye bye see you later"<<endl;break;
default:{
cin.clear();
cin.ignore(std::numeric_limits<int>::max(),'\n');
Erroronumber();
goto first;
};
}
}while(c!=3);
system("PAUSE");
return 0;
}
