You are on page 1of 1

Quiz 4(28-May-2020) Time: 40 min

Attempt all questions. Fill in the blanks with red colored font.

1. Create an array of type int called carsid. [2]

int carsid[4] = {1, 2, 3, 4};

2. Print the value of the second element in the carsid array created in 1. [1]

cout<< carsid[1] ;

3. Change the value from ‘a’ to ‘z’, in the alpha array. [2]

charalpha[4] = {‘a’, ‘b’, ‘c’, ‘d’};

charalpha[0]= ‘z’;

4. Loop through the elements in the cars array. [6]

string cars[4] = {"Volvo", "BMW", "Ford", "Mazda"};

for( int i= 0; i< 4; i++ ) {

cout <<cars[i]<< "\n";

5. Array index can be started at 1 also. [1]

a) True

b) False

You might also like