After building and debugging in Microsoft Visual Studio 2010. The sum, average and product is not calculating right. Also the large and small is not showing up in results.
When I input: 13, 27, 14
it gives me this:
http://i54.tinypic.com/vy0hsp.jpg
The Code I currently have:
Code:#include <iostream> // supports std using namespace std; // executes program int main () { int x; int y; int z; int sum; int average; int product; int smallest; int largest; cout << "Input three different intergers: "; cin >> x >> y >> z; sum = x + y + z; cout << "Sum is " << sum << endl; average = (x + y + z) / 3; cout << "Average is " << average << endl; product = (x * y * z); cout << "Product is " << product << endl; if(x < y && x < z) cout<<"Smallest: "<< x <<endl; else if(y < x && y < z) cout<<"Smallest: "<< y<<endl; else if(y < x && z < y) cout<<"Smallest: "<< z <<endl;
-TP