I'm trying to finish a homework problem that requires an integer as an input but the output result must be in decimal form.
Here's what I have...the program will run & works except for the decimal for the quotient.
[code]
int num1, num2;
float sum, difference, product, quotient;
sum = num1 + num2;
difference = num1 - num2;
product = num1 * num2;
quotient = num1 % num2;
cout << "This program computes the sum, difference, product, and quotient of any two integers" << endl;
cout << "enter an integer then press <Enter>: ";
cin >> num1;
cout << "enter your second integer then press <Enter>: ";
cin >> num2;
// Add num1 + num2 for the sum.
sum = num1 + num2;
// Subtract num2 from num1 for the difference.
difference = num1 - num2;
// Multiply num1 x num2 for the product.
product = num1 * num2;
// Divide num1 by num2 for the quotient.
quotient = num1 / num2;
// Display the sum of num1 + num2.
cout << "The sum of your two numbers is " << sum << endl;
cout << "The difference of your two numbers is " << difference << endl;
cout << "The product of your two numbers is " << product << endl;
cout << "The quotient of your two numbers is " << quotient << endl << endl;
return 0;
}