0
Why this code generated the output (values of n =00301)...??
8 Antworten
+ 1
n is element of array, first element has value 1 in 1 2 3 4 1
+ 2
Alexander Thiem thanks 😇
+ 1
Go step jy step!
First of all n is a[0], so n is 1 and a[1] is set to 0
Then n is a[1], so n is 0 and a[0] is set to 0
.....
Do this step by step and you should understand!
+ 1
or add some control prints
n=1 a[1] =2 [1, 2, 3, 4, 1] a[1] <-0
n=0 a[0] =1 [1, 0, 3, 4, 1] a[0]<-0
n=3 a[3] =4 [0, 0, 3, 4, 1] a[3]<-0
n=0 a[0]=0 [0, 0, 3, 0, 1] a[0]<-0
n=1 a[1] =0 [0, 0, 3, 0, 1] a[1] <-0
+ 1
zemiak oh sorry, I forgot the rules. u r right , n is element of array. thanks for help 😊
0
zemiak output prints the value of n .
0
zemiak n is a variable here not an element of array
0
ok, what is value in n ?