What will be the output of the following C++ code? #include using namespace std; int array1 [] int array2[] int i, result = 0; int main () (100, 200, 300, 400, 500}; = (10, 20, 30, 40, 50); for (i = 0; i < 4; i++) result += array1 [i]; for (i = 0; i < 3; i++) result += array2[il; cout « result; return 0;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.4: For Loops
Problem 12E
icon
Related questions
Question
What choice correct
age 13 of 41)
a exams.meu.edu.jo/mod/quiz/attempt.php?attempt=1164148&cmid 3288&page=12
Exams
What will be the output of the following C++ code?
#include<iostream>
using namespace std;
int array1[0 = (100, 200, 300, 400, 500};
int array20 {10, 20, 30, 40, 50);
int i, result = 0;
int main ()
for (i = 0; i < 4; i++)
result += array1[i];
for (i = 0; i < 3; i++)
result += array2[i];
cout <« result;
return 0;
Select one:
O a. 1100
O b. Error
O C 1600
O d. 1650
to search
Transcribed Image Text:age 13 of 41) a exams.meu.edu.jo/mod/quiz/attempt.php?attempt=1164148&cmid 3288&page=12 Exams What will be the output of the following C++ code? #include<iostream> using namespace std; int array1[0 = (100, 200, 300, 400, 500}; int array20 {10, 20, 30, 40, 50); int i, result = 0; int main () for (i = 0; i < 4; i++) result += array1[i]; for (i = 0; i < 3; i++) result += array2[i]; cout <« result; return 0; Select one: O a. 1100 O b. Error O C 1600 O d. 1650 to search
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr