I am writing an if-else statement, and I want the program to do nothing if a certain condition is met. The following code shows what I mean.
if(number == 0) {
//Do nothing
} else if(number % 2 == 0) {
//Do something
} else if(number % 2 == 1) {
//Do something else
}
If number is equal to zero, what I want is for the program to leave this if-else statement and move to the next portion of code, which is within a while loop
Aucun commentaire:
Enregistrer un commentaire