/*WAP to check no. is prime/not*/
import java.lang.*;
class prime
{
int num,count;
prime(int num1)
{
num=num1;
count=0;
}
void calculate_prime()
{
for(int i=1;i{
if(num%i==0)
count++;
if(count>2)
break;
}
}
void display()
{
if(count>2)
System.out.println("not prime " + num);
else
System.out.println("prime " + num);
}
}
class demo_prime
{
public static void main(String arg[])
{
prime p1=new prime(5);
prime p2=new prime(21);
p1.calculate_prime();
p1.display();
p2.calculate_prime();
p2.display();
}
}
there is some good c ,java, sql and vb6 programs,Windows tricks, sms shorthand etc
Thursday, January 7, 2010
WAP to check no. is prime/not
wap to calculate factorial
/*wap to calculate factorial*/
import java.lang.*;
class factorial
{
int num;
factorial(int a)
{
num=a;
}
int fact(int m)
{
if(m==0)
return(1);
else
return(m*fact(m-1));
}
void display()
{
int f;
f=fact(num);
System.out.println("factorial is="+f);
}
}
class demo_factorial
{
public static void main(String arg[])
{
factorial f1=new factorial(3);
f1.display();
}
}
Monday, January 4, 2010
Run Commands SHORTCUT KEYS for XP,Vista,Windows7
Run Commands SHORTCUT KEYS for XP,Vista,Windows7
- compmgmt.msc - Computer management
- devmgmt.msc - Device manager
- diskmgmt.msc - Disk management
- dfrg.msc - Disk defrag
- eventvwr.msc - Event viewer
- fsmgmt.msc - Shared folders
- gpedit.msc - Group policies
- lusrmgr.msc - Local users and groups
- perfmon.msc - Performance monitor
- rsop.msc - Resultant set of policies
- secpol.msc - Local security settings
- services.msc - Various Services
- msconfig - System Configuration Utility
- regedit - Registry Editor
- msinfo32 - System Information
- sysedit - System Edit
- win.ini - windows loading information(also system.ini)
- winver - Shows current version of windows
- mailto: - Opens default email client
- command - Opens command prompt
- appwiz.cpl - Add/Remove Programs control
- timedate.cpl - Date/Time Properties control
- desk.cpl - Display Properties control
- findfast.cpl - FindFast control
- fonts - Fonts Folder control
- inetcpl.cpl - Internet Properties control
- main.cpl - Mouse Properties control
- main.cpl keyboard - Keyboard Properties control
- mmsys.cpl - Multimedia Properties control
- netcpl.cpl - Network Properties control
- password.cpl - Password Properties control
- printers - Printers Folder control
- mmsys.cpl sounds - Sound Properties control
- sysdm.cpl - System Properties control
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();
}
}
Subscribe to:
Posts (Atom)
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
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