Posts

Showing posts with the label JAVA

Find LCM of Two Given Numbers ~ IN JAVA

Document PROGRAME THAT CALULATED L.C.M OF TWO GIVEN NUMBER IN JAVA import java.util.Scanner; public class LeastCommonMultiple { public static void main(String[] args) { int numberOne = input("Enter your first number: "), numberTwo = input("Enter your first number: "); System.out.println("The " + numberOne + " And " + numberTwo + " L.C.M Are " + lcm(numberOne,numberTwo)); } // These function use for taking input from user private static int input(String command) { Scanner input = new Scanner(System.in); System.out.print(command); return input.nextInt(); } // These function are use for lcm private static int lcm(int numberOne, int numberTwo){ int i = 1, result = 1; // Checks if i is factor of both integers while (i

Calculated the factorial of given Number ~ IN JAVA

Document PROGRAME THAT CALULATED THE FACTORIAL NUMBER OF GIVEN NUMBER IN JAVA import java.util.Scanner; public class FactorialNumber { public static void main(String[] args) { System.out.println(factorialNumber(input("WELCOME IN CALCULATED FACTORIAL PROGRAM !! \n\n Enter the number: "))); } // These function use for taking input from user private static int input(String command) { Scanner input = new Scanner(System.in); System.out.print(command); return input.nextInt(); } // This function calculated the factorial number private static long factorialNumber(int number){ long i = 1, result = 1; while (i

Program Odd Number Calculator to n number ~ IN JAVA

Document PROGRAME THAT CALULATED THE ODD NUMBER IN JAVA import java.util.Scanner; public class SumOfOddMNumber { public static void main(String[] args) { int input = input("Enter you number: "); if (checkNumberIsOdd(input)) { System.out.println("Your odd number " + input + " sum is " + sumOfOddNumber(input)); } else { System.out.println("You number is not a even number "); } } // These function use for taking input from user private static int input(String command) { Scanner input = new Scanner(System.in); System.out.print(command); return input.nextInt(); } // This function help to check the number was odd or not private static boolean checkNumberIsOdd(int number) { return number % 2 != 0; } // RETURN SUM Of odd number private static int sumOfOddNu...

Multiplication the Table Programs ~ IN JAVA

Document PROGRAME THAT CALULATED THE TABLE IN JAVA import java.util.Scanner; public class PRACTISE { public static void main(String[] args) { int table = input("Enter the table "); int limit = input("Enter the limit "); tableCalculator(table, limit); // Function call } // These function use for taking input from user private static int input(String command){ Scanner input = new Scanner(System.in); System.out.print(command); return input.nextInt(); } // These function help in nop calculate the table in limit private static void tableCalculator(int table, int limit){ int i = 1; // Initializations while (i