console input reading input
IO/Console Input
1.Take two numbers as input from the console. Your program should add these two numbers and print if their sum is odd or even.
import java.io.*;
class Sum
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int a[]=new int[2];
int res,i=1,b,c;
System.out.println("Enter two numbers");
while(i<3)
{
a[i]=(char)br.read();
if(i==1)
b=a[i];
else
c=a[i];
i ;
}
res=a[i] a[i];
if((res%2)==0)
System.out.println("It is even");
else
System.out.println("It is odd");
}
}
I am not able to get output for above program.please help me out.