Let A, B, C
Let Sum = A + B + C
Let Avg = (A + B + C) / 3
Let Prod = A * B * C
Print(Sum, Avg, Prod)
Implementation using C++:
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cout << "A = ";
cin >> a;
cout << "B = ";
cin >> b;
cout << "C = ";
cin >> c;
int sum = a + b + c;
float avg = (a + b + c) / 3.0;
int prod = a * b * c;
cout << endl;
cout << "Sum = " << sum << endl;
cout << "Average = " << avg << endl;
cout << "Product = " << prod << endl;
}
Link for testing: https://ideone.com/V3RzaC
Comments
Leave a comment