View Single Post
Old 03-20-2005, 09:27 PM   #1 (permalink)
tloc
Registered User
 
Join Date: Mar 2005
Posts: 3
tloc is on a distinguished road
noob needs some help

hello i am new to c++ and need some help on this code i want the user to choose an operator but can't figure how to do that the rest i think i got any help would be appreciated or sugestions.
Code:
#include <iostream>
using namespace std;
int main()
{
	int num1,num2;
    
	
	cout<< "Enter 2 integers:"<<endl;
	cin >> num1>>num2;
	cout<< "enter operator: + (addition),-(subtraction),* (multiplication),/(division):"<<endl;
	cin >>  +-* /;
      
    cout << "Sum is " << (num1 + num2) << endl;
    cout << "Quotient is " << (num1 / num2) << endl;
	cout << "Remainder is " << (num1 % num2) << endl;
    cout<< "product is " << (num1 * num2) << endl;
	return 0;

}
tloc is offline   Reply With Quote