Computer Science, asked by jeswinlobo903, 5 hours ago

Give the Syntax and example for initializing one dimensional array at declaration.

Answers

Answered by Suhel123
5

Answer:

int a[2][3]={0,0,0,1,1,1}; initializes the elements of the first row to zero and the second row to one. The initialization is done row by row. The above statement can also be written as int a[2][3] = {{ 0,0,0},{1,1,1}}; by surrounding the elements of each row by braces.

Answered by aprajitasingh1401
3

Answer:

Ex: int a[2][3]={0,0,0,1,1,1}; initializes the elements of the first row to zero and the second row to one. The initialization is done row by row. The above statement can also be written as int a[2][3] = {{ 0,0,0},{1,1,1}}; by surrounding the elements of each row by braces.

please mark me as a brainliest

Similar questions