Labels
Armstrong
(1)
Array
(1)
Celsius to Fahrenheit
(1)
Commandline
(4)
even odd
(1)
Factorial
(1)
Fibonacci
(1)
Hello World
(1)
Java.Lang.Math
(1)
java.util.Arrays
(1)
Java.Util.Scanner
(3)
Reverse of number
(1)
Rhombus
(1)
Square Root
(1)
Table
(1)
Showing posts with label Commandline. Show all posts
Showing posts with label Commandline. Show all posts
Wednesday, 18 September 2013
Wednesday, 11 September 2013
Java Program to find factorial of a given number through Commandline
Tuesday, 10 September 2013
Java Program to find out entered number is armstrong or not through Commandline
class Arm
{
public static void main(String ar[])
{
int num=Integer.parseInt(ar[0]);
int n=num;
int check=0,remainder;
while(num>0)
{
remainder=num%10;
check=check+(int) Math.pow(remainder,3);
num=num/10;
}
if(check==n)
{
System.out.println("This is armstrong number");
}
else
{
System.out.println("This is not armstrong number");
}
}
}
{
public static void main(String ar[])
{
int num=Integer.parseInt(ar[0]);
int n=num;
int check=0,remainder;
while(num>0)
{
remainder=num%10;
check=check+(int) Math.pow(remainder,3);
num=num/10;
}
if(check==n)
{
System.out.println("This is armstrong number");
}
else
{
System.out.println("This is not armstrong number");
}
}
}
Output:
Monday, 9 September 2013
Java Program to make table of user entered a number through Commandline
Subscribe to:
Posts (Atom)



