asked 211k views
3 votes
Read this program and select the output. #include using namespace std; int main() { int a, b, sum ; double c ; a = 3; b = 5; c = 14.1; sum = a + b + c; c /= a; b += c - a; a *= 2 * b + c; cout << a << '\t' << b << '\t' << c << '\t' << sum << endl; return 0 ; }

asked
User Hamelraj
by
8.3k points

1 Answer

6 votes

Final answer:

The program calculates the values of variables a, b, c, and sum. The line a *= 2 * b + c; multiplies the value of a by 2 * b + c. The output statement prints the current values of a, b, c, and sum separated by tabs.

Step-by-step explanation:

The given program calculates the values of variables a, b, c, and sum.

The line a *= 2 * b + c; multiplies the value of a by 2 * b + c. Then, the output statement, cout << a << ' ' << b << ' ' << c << ' ' << sum << endl;, prints the current values of a, b, c, and sum separated by tabs.

The output of the program will depend on the initial values of a, b, and c.

answered
User Jon Derring
by
8.4k points