This is my code:
int numb = 50;
int odd;
int even;
while (numb <= 100 )
{
if (numb % 2 == 0)
{
even = numb;
System.out.println(even);
System.out.print(", ");
numb++;
}
System.out.println("");
if(numb % 2 != 0)
{
odd = numb;
System.out.print(odd);
System.out.print(", ");
numb++;
}
}
So far, it prints two columns of answers but i need to separate rows of evens and odds. What am I doing wrong?
Aucun commentaire:
Enregistrer un commentaire