#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
int x , y, z;
cout << "input three different integers:\n";
cin >> x >> y >> z;
cout << "sum is " << x + y + z << endl;
cout << "average is " << (x+y+z)/3 << endl;
cout << "product is " << x*y*z << endl;
cout << "smallest is " << (z>y) ? ( (y>x) ? x : y ) : ((z>x) ? x : z) << endl;
cout << "biggest is " << (z>y) ? ( (z>x) ? z : x ) : ((y>x) ? y : x) << endl;
return 0;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.