Examveda

Consider the following piece of code in C++, how many elements will be stored in the array 'arr' if the user enters the values of a, b, c and d as 10, 20, 30, and 40 respectively?
#include<iostream>                                                  
using namespace std;                                                    
int main() 
{                                                                               
    int a, b, c, d;                                                        
    cout<<”Enter the value of a, b, c, d: “;                       
    cin>>a>>b>>c>>d;                
    int arr[a - b/c + d];                                                 
}

A. 30

B. 40

C. 50

D. 60

Answer: Option C


This Question Belongs to Data Structure >> Arrays In Data Structures

Join The Discussion

Related Questions on Arrays in Data Structures