in Programming in C
525 views
0 votes
0 votes

suppose i have declared array

int a[5] = { 1,2,3,4,5} ;

and i want to print output as :

a[0] = 1

a[1]  = 2

a[2] = 3

a[3]  = 4

a[4]  =5

can anyone write program  in c  displaying this output .

in Programming in C
525 views

4 Comments

Sukannya  thank you

( a[%d]=%d\n",i,a[i]  )

explain this in little please

0
0
%d in the index of a takes the value of i which is 0 and the next %d is taking a[i] which is 1.
1
1

thanks Sukannya

1
1

Please log in or register to answer this question.

Related questions