Loops regarding increment (overthinking !! resulted to doubt)
So the code ; 1)code int num = 1; while(num < 6) { Console.WriteLine(num); num+=2; } Displays 1,3 and 5 and also compare to this code; 2)code int num = 0; while(num++ < 6) Console.WriteLine(num); Which results 6 answers in total.. So my question is that why the first code displays only upto 5..cause once it becomes 3 and goes again on the loop it passes the while and gets checked for less than 6 and then thus results 5..so why doesn't it result something 7 after that..cause it goes again to the loop once the answer is 5,to check weather there satisfied or not..cause it meets the while statement first so why doesn't it also result 7 been displayed..... And then if that happened in code 1 then why does this happens in code 2..I mean why does that executes for 6 times..but not the first code.. I mean anyhow to complete the code it has to go pass the while..so why doesn't the 1st code results number 7 ? Hope u understand my silly question 😁🤟