English

The following statement : int code[ ]= {25, 37, 38, 42); - Computer Applications

Advertisements
Advertisements

Question

The following statement : int code[ ]= {25, 37, 38, 42);

Options

  • Assigns 37 to code[1]

  • Assigns 25 to code[1]

  • Assigns 38 to code[3]

  • Assigns 42 to code[0]

MCQ

Solution

Assigns 37 to code[1]

Explanation:

The statement int code[ ]= {25, 37, 38, 42}; assigns 37 to code[1] as the array index begins from 0. So the second value (37) will be assigned to code[1].

shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Arrays (Single Dimensional and Double Dimensional) - EXERCISES [Page 238]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 3 Arrays (Single Dimensional and Double Dimensional)
EXERCISES | Q I. 7. | Page 238
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×