package com.nano.OddEven;
import java.io.*;
public class OddEven {
/**
*
* Author : Karthik.T
* Date : 15-07-2012
*
*/
public static void main(String[] args) {
try
{
int a;
System.out.println("Odd Numbers Even NUmbers");
System.out.println("Condition : Odd = Odd+1 Even=Even-1 No cntl No Loop");
System.out.println("Enter Any Number : ");
DataInputStream g=new DataInputStream(System.in);
a=Integer.parseInt(g.readLine());
System.out.println("Result is :" + (a-1+(2*(a%2))));
System.out.println();
}
catch(Exception e)
{
}
}
}
excellent
ReplyDeleteby vinoth