KnowledgeBoat Logo
LoginJOIN NOW

Computer Applications

int P[ ] = {12, 14, 16, 18};
int Q[ ] = {20, 22, 24};

Place all elements of P array and Q array in the array R one after the other.

(a) What will be the size of array R[ ] ?

(b) Write index position of first and last element?

Java Arrays

ICSE Sp 2024

51 Likes

Answer

int R[ ] = {12, 14, 16, 18, 20, 22, 24};

(a) Size of array P[ ] = 4
     Size of array Q[ ] = 3
     Size of array R[ ] = 7 (4 + 3).

(b) Index position of first element is 0.
     Index position of last element is 6.

Answered By

34 Likes


Related Questions