Vidyalelo
C++ Programming · Q52

Arrays and Strings in C++

Programming · C++ Programming · question 52

Q52

What will be the output of the following C++ code? #include #include using namespace std; int array1[] = 1200, 200, 2300, 1230, 1543; int array2[] = 12, 14, 16, 18, 20; int temp, result = 0; int main() for (temp = 0; temp < 5; temp++) result += array1[temp]; for (temp = 0; temp < 4; temp++) result += array2[temp]; cout << result; return 0;

A.
6553
B.
6533
Answer
C.
6522
D.
12200

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board