Can we initialize an array with any number other than zero in a single statement ( without the use of loops )?
Arrays initialization Doubt
you can write as : int arr[ ]={1,2,3,5,7,9};
for 2-D array, you can write
int arr[ ][ 3]={
{1,2,3},
{4,5,6},
{7,8,9} };
I want to initialize a large size array and all elements with same number( other than zero ). How to do that without loops ?
You can do that using,
int ar[ ]={any no};
Try with this approach,