0
write a java program to input both odd or both even number. display even series or odd series with the limit. display error message in a dialog box if one is even and other is odd?
3 odpowiedzi
0
make it clear first.... store the values in an array and if(a[I]%2==0) then even else odd
0
Scanner input = new Scanner (System.in);
int a;
System.out.print("enter a number: ");
a=input.nextInt();
if (a%2==0)
{
System.out.print("even");
}
else if (a!=1)
{
System.out.print("odd");
}
else
{
System.out.print("neutral");
}
0
Vanessa...else if part is not necessary.. check again