<code=java>
i m giving again a very simple code of odd or even . I want that user should give the value of x and thereafter ,it is checked whether odd or even.
class oddoreven
{
public static void main (String args[])
{
int x;
System.out.println ("Enter an integer to check if it is even or odd ");
if(x%2==0)
System.out.println("you entered an even number ,");
else
System.out.println("You entered an odd number .");
}
}
In this prog user should give the value of x and it is then checked. But i m getting an error that variable x might not have been initialized. Thanks