What will be the output of-
for(int i=0; i<= 5;i++)
System.out.print(i+”,”);
Answers
Answered by
1
Answer:
0,1,2,3,4,5
Explanation:
the loop will execute 6 times according to the control statement
every time the loop executes ,it will print the value of i with comma(as a string)
,after executing one time the control will go the update statement(i++ in this case) and change the value of i(increase it by one)
this loop will execute until the control statement become false ,i.e. when i=6
Hope this will work
Similar questions