Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "Please enter symbol: ";
- char sym;
- cin >> sym;
- cout<<"Please enter the first number:";
- int num1;
- cin>>num1;
- cout<<"Please enter the operrator:";
- char opp;
- cin>>opp;
- cout<<"Please enter the second number:";
- int num2;
- cin>>num2;
- int wid=10;
- int len=50;
- cout << endl;
- for (int a = 1; a <= wid; a++){
- for (int b = 1; b <= len; b++)
- {
- if (a == 1)
- cout << sym;
- else if (b == 1)
- cout << sym;
- else if (a == wid)
- cout << sym;
- else if (b == len)
- cout << sym;
- else
- cout << " ";
- }
- cout << endl;
- }
- int answer;
- gotoxy(18,9);
- if(opp=='+'){
- answer=num1 + num2;
- cout<<num1<<" + "<<num2<<" = "<<answer;
- }
- if(opp=='/'){
- answer=num1 / num2;
- cout<<num1<<" / "<<num2<<" = "<<answer;
- }
- if(opp=='*'){
- answer=num1 * num2;
- cout<<num1<<" * "<<num2<<" = "<<answer;
- }
- if(opp=='-'){
- answer=num1 - num2;
- cout<<num1<<" - "<<num2<<" = "<<answer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement