+ 1

Why cant i just write +=1;

16th Oct 2021, 5:36 PM
Pavan Nimavat
Pavan Nimavat - avatar
3 Respuestas
+ 3
Can You Please Give More Details On Your Question...
16th Oct 2021, 5:39 PM
Sancho Godinho
Sancho Godinho - avatar
+ 3
Actually, The Error Is Not With The +=1 But With The While Loop... Repaired Code: Num = 1; while(Num < 6) { // Your Code Here... Num += 2; }
16th Oct 2021, 6:24 PM
Sancho Godinho
Sancho Godinho - avatar
+ 2
Nvm i got it , it was Num = 1; While(num <6) { Num += 2; } I was answered num+=1 but it was incorrect, but then i read the question and it says find odd numbers, so it has to be 2.
16th Oct 2021, 5:45 PM
Pavan Nimavat
Pavan Nimavat - avatar