The task is to write a program that requests four integers a, b, c and d. The program should output two values of arithmetic expressions separated by spaces in the first line:
- (a + b) 3
- (c - d) 4
In the second line, the program should output three values of arithmetic expressions through a space:
- (a + 2ab + b) 2
- (c - (3cd) 2 + 5) 2
- 6 (b 2 - 4ac) 2
Code:
#include <iostream> using namespace std; int main() { int a, b, c, d; cout << (a+b) * (a+b) * (a+b) * (a+b) << " " << (cb) * (cb) * (cb) * (cb) << endl; cout << ((a + (2*a*b) + b) * (a + (2*a*b) + b)) << " " << (c - ((3*c*d) * (3*c*d)) + 5) * (c - ((3*c*d) * (3*c*d)) + 5) << " " << 6 * (((b*b) - 4*a*b)) * ((b*b) - 4*a*b) << endl; return 0; } This code should output:
27 1 49 18496 384 And displays:
0 0 0 25 0 Please help me: what is wrong?