5.6 Switch challenge
So, I give you two simple exercises to do. The first is to create a loop that will display 0 to 100. And the second to create a loop that will display the opposites so 100 to 0. You’re ready. Go on! I hope you’ve succeeded now, we’ll make the correction. So, "For". In parentheses "int i" equals 0 semicolon "i" <= 100 semicolon i++ and we will display, then we execute the code, And it shows us 0 to 100. But we can also do "int = 0". Before the for loop. It works too. And as we can see now, we will do the second exercise. So I’m going to comment. The first loop. Then, change the variable int. to 100 And therefore make the second loop for. for in parentheses semicolon i >= 0 i "--"so we decremente i And there, we display The variable i. Then we execute the code. And as you can see. That’s good, 100 to 0. That was all for this course In the next video, we’ll see the while loop and then the do while loop See you in the next video!