Select from following answers:- value of i = 0 and it will be printed infinite times

- value of i = 0 and it will be printed 1 time
- value of i = -1 and it will be printed infinite times
- value of i = -1 and it will be printed 1 time
- All Above
value of i = 0 and it will be printed infinite times.
The initial value of i is 0; Then 0 is checked with 1 which is smaller and the condition satisfies. The inner statement inside the loop executed i.e. i value 0 is printed. Then i has been decremented to -1.Then the value of i is incremented to 0 again because of i++ . And the process continues for ever.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator