Computer Science, asked by fraz, 1 year ago

write a java program to accept a even or odd number

Answers

Answered by tithi
3
class number
{
public static void main(String args[])
{
int p;
System.out.println("please enter the number");
p=Integer.parseInt(args[0]);
if(p/2==0)
System.out.println("The number is even");
else
System.out.println("The number is odd");
}
}
hope i helped u:)

tithi: plzz mark as best if helpful!
Answered by Anonymous
7
Here is your code

class number
{
public static void main(String args[])
{
int p;
System.out.println("enter the number");
p=Integer.parseInt(args[0]);
if(p/2=0)
System.out.println("the number is even");
else
System.out.println("the number is odd");
}
}
Similar questions