T Tâm Tây New member Sep 19, 2021 #1 What is the output of the following code? Code: i=0;for j=0:2 j=j-1 end A. Infinite loop B. -1 C. Output is suppressed D. +1
What is the output of the following code? Code: i=0;for j=0:2 j=j-1 end A. Infinite loop B. -1 C. Output is suppressed D. +1
N Nguyễn Tân New member Sep 19, 2021 #2 Answer: b Explanation: The output is suppressed since there is a semi-colon after the decrement of j. The counter variable is really treated as a different variable hence the value of j at the end of the loop is not 2. Upvote 0 Downvote
Answer: b Explanation: The output is suppressed since there is a semi-colon after the decrement of j. The counter variable is really treated as a different variable hence the value of j at the end of the loop is not 2.