Earn by twitter on twivert

Sign up for PayPal and start accepting credit card payments instantly.

Sunday, January 3, 2010

WAP to check no. is even/odd


/*WAP to check no. is even/odd*/

import java.lang.*;

class evenodd
{
int num,status;
evenodd(int num1)
{
num=num1;
}
void calculate_evenodd()
{
if(num%2==0)
status=1;
else
status=0;
}
void display()
{
if(status==1)
System.out.println("no. is EVEN" + num);
else
System.out.println("no. is ODD" + num);
}
}


class demo_evenodd
{
public static void main(String arg[])
{
evenodd eo1=new evenodd(6);
evenodd eo2=new evenodd(21);

eo1.calculate_evenodd();
eo1.display();

eo2.calculate_evenodd();
eo2.display();
}
}

No comments:

Post a Comment

ADS

How to earn online

How to earn online:
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786

AddMe

Bookmark and Share