-
What will be the output of this program?
#include
using namespace std;
int arr1[] = {150, 50, 230, 130, 160};
int arr2[] = {13, 15, 30, 28, 50};
int temp, res = 0;
int main()
{
for (temp = 0; temp < 5; temp++)
{
res += arr1[temp];
}
for (temp = 0; temp < 4; temp++)
{
res += arr2[temp];
}
cout << res;
return 0;
}
-
- 806
- 150
- 130
- 13
- 15
Correct Option: A
In this program we are adding the every element of two arrays. Finally we got output as 806.