Yahoo India Web Search

Search results

  1. 5 days ago · Learn how to find all the prime numbers from 1 to N using different methods in Java. Compare the time complexity, auxiliary space and output of each approach with examples and code snippets.

    • 5 min
  2. 5 days ago · Learn what prime numbers are and how to check if a number is prime using various methods. See C++ and Java code examples for primality test and sieve of Eratosthenes algorithms.

    • 14 min
  3. 5 days ago · Write a program to print the first 10 prime numbers. Note: A number N is said to be prime if it has exactly two factors i.e. 1 and the number itself N. Output Format: 2, 3, 5, 7, 9… Approach:

  4. 3 days ago · Steps to Write a Program Check a Prime Number. Here are the steps required to check whether an entered number is prime or not. First, we ask the user to enter a number. Then we create a loop from 2 to half of that number.

  5. 3 days ago · Frequently asked Java basic programs include Fibonacci series, prime numbers, factorial numbers, and palindrome numbers, among others. Each program is accompanied by multiple examples and their respective outputs.

  6. 4 days ago · In this video, I have explained about "Write a java program to print the prime numbers ranging from 10 to 60 using while loop".

  7. People also ask

  8. 4 days ago · print(f"{num} is not a prime number") break. i = i + 1. x = x + 1. i = 2. y = 1. print(f"{num} is a prime number") You loop on x twice, and the inner loop never changs the value of x. So unless your condition num % y == 0 is met, and the break executed, there is no way you will ever get outside this inner loop.

  1. People also search for