Contents

How many elements are in array?
a) 5                        
b) 6                        
c) 4                        
d) 0

a

Given the following declaration, where is 77 stored in n array.
int n[]={83, 62, 77, 97}
a) n[0]   
b) n[1]   
c) n[2]   
d) n[4]

c

How many elements does the following array have?
int n[1000];
a) 1000 
b) 998   
c) 0                        
d) 999

a

What is the output of following code?
int n[4]= {8,7,6,3};
cout<<n[3];
a) 0                        
b) -1                       
c) 1                        
d) 3

d

What is the output of following code?
int n[4]= {56,90,86,97,120};
cout<<n[3];
a) 97
b) 98                      
c) 99                      
d) 90

a

Which of the following is correct code to initialize an array?
a) int a[6]={4,7,8,2,5,9};   
b) int a[6] {4,7,8,2,5,9};
c) int a[6]=(4,7,8,2,5,9);
d) int a[6] (4,7,8,2,5,9);

a