so this is one i have made, although full of bugs, but would work, must try out.
Thanks for having a Look.
- Code: Select all
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"Welcome To The Calculator Full Of Bugs\nBut this is how the actual calculator should work";
cout<<"\n\t\tBy CyberSpy\n";
char oprator;
int val1, val2;
cout<<"\n\n\nSo What Your Waiting For Start Calculating\n\n\nNote-This Only accepts 2 arguments\n\n\n";
Stuff:
cout<<endl;
cin>>val1>>oprator>>val2;
switch (oprator)
{
case '%':
{
cout<<"="<<val1%val2;
goto Stuff;
break;
}
case '/':
{
cout<<"="<<val1/val2;
goto Stuff;
break;
}
case '*':
{
cout<<"="<<val1*val2;
goto Stuff;
break;
}
case '+':
{
cout<<"="<<val1+val2;
goto Stuff;
break;
}
case '-':
{
cout<<"="<<val1-val2;
goto Stuff;
break;
}
default:
{
cout<<"\nSyntax Error!!!\n";
goto Stuff;
break;
}
}
system("pause");
return 0;
}
