SquareCube_Uservalues
class squarecube
{
public static void main(String a[])
{
int x,y,z;
x=Integer.parseInt(a[0]);
y=x*x;
z=x*x*x;
System.out.println(" Square of entered integer is "+y);
System.out.println(" Cube of entered integer is "+z);
}
}
The only blog for java programs and college assignments
class squarecube
{
public static void main(String a[])
{
int x,y,z;
x=Integer.parseInt(a[0]);
y=x*x;
z=x*x*x;
System.out.println(" Square of entered integer is "+y);
System.out.println(" Cube of entered integer is "+z);
}
}
at
9:49 AM
0
comments
Posted by
mohan2388
Labels: SquareCube_Uservalues
class useradd
{
public static void main(String a[])
{
int x,y,z;
x=Integer.parseInt(a[0]);
y=Integer.parseInt(a[1]);
z=x+y;
System.out.println("THE SUM IS "+z);
}
}
at
9:43 AM
0
comments
Posted by
mohan2388
Labels: Addition Uservalues
class factorial
{ public static void main(String a[])
{
int fact=1,i;
int d=Integer.parseInt(a[0]);
for(i=1;i<=d;i++)
fact=fact*i;
System.out.println("factorial="+fact);
}
}
at
9:35 AM
0
comments
Posted by
mohan2388
Labels: Factorial Program