πŸ“Š C++
Q. What is the result of the following C++ program?
Code:
#include <stdio.h>
#include<iostream>
using namespace std;
int main ()
{
  int arr[] = {0, 2, 4, 2, 1};
  int n, s = 0;
  for (n = 0; n < 6; n++) {
    s += arr[n];
  }
  cout << s;
  return 0;
}
  • (A) 8
  • (B) 9
  • (C) 10
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (D) None

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
197
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
89%
Success Rate