its_arpit_singh_29_143
Contact information, map and directions, contact form, opening hours, services, ratings, photos, videos and announcements from its_arpit_singh_29_143, Editor, .
import java.util.Scanner; public class PrimeNumberGenerator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the number of prime numbers to generate: "); int numPrimes = scanner.nextInt(); scanner.close(); System.out.println("The first " + numPrimes + " prime numbers are:"); generateAndPrintPrimes(numPrimes); } public static boolean isPrime(int number) { if (number
generates and prints the first N prime numbers: import java.util.Scanner; public class PrimeNumberGenerator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter the number of prime nu…
javaCopy codeimport java.util.Scanner; public class StringReversal { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a string: "); String input = scanner.nextLine(); scanner.close(); String reversed = reverseString(input); System.out.println("Reversed string: " + reversed); } public static String reverseString(String input) { StringBuilder reversed = new StringBuilder(); for (int i = input.length() - 1; i >= 0; i--) { reversed.append(input.charAt(i)); } return reversed.toString(); } } …...
Java program that reverses a string: javaCopy codeimport java.util.Scanner; public class StringReversal { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a string: & #822…
javaCopy codepublic class ArrayMaxElement { public static void main(String[] args) { int[] numbers = {5, 8, 3, 9, 2}; int max = findMaxElement(numbers); System.out.println("Maximum element: " + max); } public static int findMaxElement(int[] numbers) { int max = numbers[0]; for (int i = 1; i < numbers.length; i++) { if (numbers[i] > max) { max = numbers[i]; } } return max; } } …...
Java program that finds the maximum element in an array: javaCopy codepublic class ArrayMaxElement { public static void main(String[] args) { int[] numbers = {5, 8, 3, 9, 2}; int max = findMaxElement(numbers); System.out.println(“Maximum element: &…
javaCopy codeimport java.util.Scanner; public class PalindromeChecker { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a string: "); String input = scanner.nextLine(); scanner.close(); boolean isPalindrome = checkPalindrome(input); if (isPalindrome) { System.out.println("The string is a palindrome."); } else { System.out.println("The string is not a palindrome."); } } public static boolean checkPalindrome(String input) { String reversed = ""; for (int i = input.length() - 1; i >= 0; i--) { reversed += input.charAt(i); } return input.equalsIgnoreCase(reversed); } } …...
Java program that checks if a string is a palindrome or not: javaCopy codeimport java.util.Scanner; public class PalindromeChecker { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a string: & #…
javaCopy codepublic class BubbleSort { public static void main(String[] args) { int[] numbers = {7, 2, 9, 1, 5}; System.out.println("Before sorting:"); printArray(numbers); bubbleSort(numbers); System.out.println("After sorting:"); printArray(numbers); } public static void bubbleSort(int[] numbers) { int n = numbers.length; boolean swapped; for (int i = 0; i < n - 1; i++) { swapped = false; for (int j = 0; j < n - i - 1; j++) { if (numbers[j] > numbers) { // Swap numbers[j] and numbers int temp = numbers[j]; numbers[j] = numbers; numbers = temp; swapped = true; } } // If no two elements were swapped in the inner loop, the array is already sorted if (!swapped) { break; } } } public static void printArray(int[] numbers) { for (int number : numbers) { System.out.print(number + " "); } System.out.println(); } } …...
Java program that performs bubble sort on an array of integers: javaCopy codepublic class BubbleSort { public static void main(String[] args) { int[] numbers = {7, 2, 9, 1, 5}; System.out.println(“Before sorting:”); printArray(numbers); bubbleSort(n…
javaCopy codeimport java.util.Scanner; public class FibonacciSeries { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the number of terms: "); int numTerms = scanner.nextInt(); scanner.close(); System.out.println("Fibonacci series up to " + numTerms + " terms:"); for (int i = 0; i < numTerms; i++) { int fibNumber = fibonacci(i); System.out.print(fibNumber + " "); } } public static int fibonacci(int n) { if (n
Java program that calculates the Fibonacci series up to a given number of terms: javaCopy codeimport java.util.Scanner; public class FibonacciSeries { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter the number of …
javaCopy codeimport java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); scanner.close(); int factorial = calculateFactorial(number); System.out.println("Factorial of " + number + " is: " + factorial); } public static int calculateFactorial(int number) { if (number == 0 || number == 1) { return 1; } else { return number * calculateFactorial(number - 1); } } } …...
Java program that calculates the factorial of a number using recursion: javaCopy codeimport java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a number: “); …
javaCopy codeimport java.util.Scanner; public class SumOfDigits { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); scanner.close(); int sum = calculateSumOfDigits(number); System.out.println("Sum of digits in " + number + " is: " + sum); } public static int calculateSumOfDigits(int number) { int sum = 0; while (number != 0) { int digit = number % 10; sum += digit; number /= 10; } return sum; } } …...
Java program that finds the sum of digits in a number: javaCopy codeimport java.util.Scanner; public class SumOfDigits { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a number: “)…
javaCopy codepublic class ArraySum { public static void main(String[] args) { int[] numbers = {2, 4, 6, 8, 10}; int sum = calculateSum(numbers); System.out.println("Sum of the numbers: " + sum); } public static int calculateSum(int[] numbers) { int sum = 0; for (int number : numbers) { sum += number; } return sum; } } In this program, we have an array of numbers....
Java program : that calculates the sum of numbers in an array javaCopy codepublic class ArraySum { public static void main(String[] args) { int[] numbers = {2, 4, 6, 8, 10}; int sum = calculateSum(numbers); System.out.println(“Sum of the numbers: & #8221…
javaCopy codeimport java.util.Scanner; public class PrimeNumber { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); scanner.close(); boolean isPrime = checkPrime(number); if (isPrime) { System.out.println(number + " is a prime number."); } else { System.out.println(number + " is not a prime number."); } } public static boolean checkPrime(int number) { if (number
Java program :checks if a number is prime or not javaCopy codeimport java.util.Scanner; public class PrimeNumber { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a number: “)…
javaCopy codeimport java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int number = scanner.nextInt(); scanner.close(); int factorial = calculateFactorial(number); System.out.println("Factorial of " + number + " is: " + factorial); } public static int calculateFactorial(int number) { if (number == 0 || number == 1) { return 1; } else { return number * calculateFactorial(number - 1); } } } …...
Java program :the factorial of a number javaCopy codeimport java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a number: “); …
here's a simple Java program that prints "Hello, world!" to the console: typescriptCopy codepublic class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } } To run this program, save the code in a file named HelloWorld.java and compile it using the following command in a terminal or command prompt: Copy codejavac HelloWorld.java Then, run the compiled code using the following command: Copy codejava HelloWorld
JAVA PROGRAM : Hello world here’s a simple Java program that prints “Hello, world!” to the console: typescriptCopy codepublic class HelloWorld { public static void main(String[] args) { System.out.println(&…
The African wild dog is one of the world’s most endangered mammals and can be identified by its long legs and irregular fur patterns.©iStock.com/Ondrej Prosicky African Wild Dog Also called the African hunting dog, Cape hunting dog, or painted dog, its scientific name (Lycaon pictus) means “painted wolf.” It refers to its mottled fur color pattern. This canine species is native to the grasslands, forests, and deserts of sub-Saharan Africa, and is the only living member of the genus Lycaon....
https://arpit143blog.wordpress.com/2023/04/12/top-10-wild-dog-breeds-in-the-world-wolves-foxes-coyotes-jackalsthese-are-just-some-of-the-wild-dog-breeds-that-roam-our-planet/
Top 10 Wild Dog Breeds in the World Wolves, foxes, coyotes, jackals…these are just some of the wild dog breeds that roam our planet. The African wild dog is one of the world’s most endangered mammals and can be identified by its long legs and irregular fur patterns.©iStock.com/Ondrej Prosicky African Wild Dog Also call…
#10. Vaquita On the brink of extinction, the vaquita is the smallest living species of cetacean. ©Paula Olson, NOAA, Public domain, via Wikimedia Commons – License The single rarest animal in the world is the vaquita (Phocoena sinus). This porpoise lives only in the extreme northwestern corner of the Gulf of California in Mexico. Since the population was recorded at 567 in 1997, it has since declined to its current state of 18....
TOP 10 of the rarest animals on Earth known to man: #10. Vaquita On the brink of extinction, the vaquita is the smallest living species of cetacean. ©Paula Olson, NOAA, Public domain, via Wikimedia Commons – License The single rarest animal in …
Silicon Valley Bank also held a lot of long-term debt that had declined in market value as the Fed raised interest rates to fight inflation. As a result, it faced huge losses when it had to sell those securities to raise cash to meet a wave of withdrawals from customers. Why did the Silicon Valley Bank fail? The collapse of Silicon Valley Bank is the largest bank failure in the United States since the global financial crisis. ...
why silicon valley bank collapse Silicon Valley Bank also held a lot of long-term debt that had declined in market value as the Fed raised interest rates to fight inflation. As a result, it faced huge losses when it had to sell th…
Petrol prices opened the third week of February 2023 standing at the rate of Rs.96.76 per litre. International oil prices- this refers to the price of crude oil, which is the primary component of petrol. The price of crude oil is influenced by global supply and demand, geopolitical tensions like the Russia-Ukraine conflict, and changes in the market due to the ongoing COVID-19 pandemic…...
Reason for high price of fuel Petrol prices opened the third week of February 2023 standing at the rate of Rs.96.76 per litre. International oil prices- this refers to the price of crude oil, which is the primary component of p…