\n";
goto passs;
}
case 2:
{
int kl;
cout<<"\n\nok thank you for using our program\n\n";
cout<<"are you want to exit program\n";
cout<<"\nenter 1 for no\n";
cout<<"\npress any other number for yes\n";
cin>>kl;
if(kl==1)
goto ass;
else
break;
}
case 3:
{
goto ass;
}
default:
cout<<"\ninvalid number\n";
goto go;
break;
}
}
int opp;
cout<<"if you want to calculate any thing\n";
cout<<"press 9 for yes\n";
cout<<"otherwise press any other number\n";
cin>>opp;
switch(opp)
{
int ll;
case 9:
calculator();
cout<<"if you want to renter data\n";
cout<<"press 4\n";
cout<<"else program will exit\n";
cin>>ll;
if(ll==4)
goto ass;
else
break;
default:
break;
}
getch();
}
//user define function//
void calculator()
{
int a,b;
char oppp;
int abc;
h:
cout<<"\n\nare you want to calculate \n";
cout<<"values\n";
cout<<"enter 1 for yes\n";
cout<<"else enter any other number:\n";
cin>>abc;
switch(abc)
{
case 1:
cout<<"\n";
ppp:
cout<<"enter first value"<<endl;
cin>>a;
cout<<"enter operator"<<endl;
cin>>oppp;
cout<<"enter secound values"<<endl;
cin>>b;
switch(oppp)
{
case '+':
cout<<"="<<a+b;
goto h;
break;
case '-':
cout<<"="<<a-b;
goto h;
break;
case '*':
cout<<"="<<a*b;
goto h;
break;
case '/':
if(b==0)
{
cout<<"invalid number"<<endl;
cout<<"enter again"<<endl;
goto ppp;
}
else
cout<<"="<<a/b;
goto h;
break;
case '%':
cout<<"="<<a%b;
goto h;
break;
default:
cout<<"invalid number:";
goto h;
}
default:
break;
}
}