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 armstrong/not


/*WAP to check no. is armstrong/not*/

import java.lang.*;
class arms
{
int num,i,rem,sum=0,status,b;
arms(int a)
{
num=a;
}
void calculate()
{
i=num;
while(i>0)
{
rem=i%10;
b=rem*rem*rem;
sum=sum+b;
i=i/10;
}
if(sum==num)
status=1;
else
status=0;
}
void display()
{
if(status==1)
System.out.println("ARMSTRONG"+sum);
else if(status==0)
System.out.println("not Armstrong"+sum);
}
}
class demo_arms
{
public static void main(String arg[])
{
arms a1=new arms(153);
a1.calculate();
a1.display();
}
}

WAP to check palendron


/*WAP to check palendron*/

import java.lang.*;
class palindrome
{
int num,i,rem,rev=0,status;
palindrome(int a)
{
num=a;
}
void calculate()
{

i=num;
while(i>0)
{
rem=i%10;
rev=rev*10+rem;
i=i/10;
}
if(num==rev)
status=1;

else
status=0;

}

void display()
{
if(status==1)
System.out.println("palindrome"+rev);
else if(status==0)
System.out.println("Not palindrome"+rev);
}
}
class demo_palendron
{
public static void main(String arg[])
{
palindrome p1=new palindrome(231);
p1.calculate();
p1.display();
}
}

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();
}
}

WAP to display welcome


/*WAP to display welcome*/

import java.lang.*;
class name
{
public static void main(String arg[])
{
System.out.println("WELCOME");
}
}

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