posted 15 years ago
This Example is from Inquisition.
Might this can help you..
First loop :-i=1 and arr = {1,2,3,4}
arr[1] = 0; and arr becomes {1,0,3,4}
--------------------------------------------
sec loop :-i=0 and arr = {1,0,3,4}
arr[0] = 0; and arr becomes {0,0,3,4}
--------------------------------------------
Third loop :-i=3 and arr = {0,0,3,4}
arr[3] = 0; and arr becomes {0,0,3,0}
--------------------------------------------
Fourth loop :-i=0 and arr = {0,0,3,0}
arr[0] = 0; and arr becomes {0,0,3,0}
--------------------------------------------
--------------------------------------------
final output - {0,0,3,0}
kaushik Vira
-------------------------------------
SCJP, Preparing SCWCD..