Complete the code to read two integers from input.
#include <iostream> int main() { int a, b; std::cin >> [1] >> b; std::cout << a + b << std::endl; return 0; }
The variable a is declared and should be used to read the first integer input.
Complete the code to output the product of two integers.
#include <iostream> int main() { int x = 4, y = 5; std::cout << x [1] y << std::endl; return 0; }
The multiplication operator * is used to calculate the product of two numbers.
Fix the error in the code to correctly read three integers and output their sum.
#include <iostream> int main() { int a, b, c; std::cin >> a >> b >> [1]; std::cout << a + b + c << std::endl; return 0; }
The variable c is declared and should be used to read the third integer input.
Fill both blanks to read two floats and output their average.
#include <iostream> int main() { float [1], [2]; std::cin >> a >> b; std::cout << (a + b) / 2 << std::endl; return 0; }
The variables a and b are used to read the two float inputs.
Fill all three blanks to read three integers and output their maximum.
#include <iostream> #include <algorithm> int main() { int [1], [2], [3]; std::cin >> x >> y >> z; int max_val = std::max([1], std::max([2], [3])); std::cout << max_val << std::endl; return 0; }
The variables x, y, and z are declared and used to read input and find the maximum.
