Query in the initialization

Hello, instead of writing

i = 0 ;
j = sizeof (a) / sizeof (int) - 1 ;

can I write :

i = 0;
j = n - 1;

where n is the number of elements in array

hello @yashsharma4304
yeah u can write.

sizeof(a)/sizeof(int) is giving n only.

1 Like