#C12178. Find Prime Numbers in a Range
Find Prime Numbers in a Range
Find Prime Numbers in a Range
You are given two integers start and end. Your task is to find and print all prime numbers between start and end (inclusive). A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In mathematical notation, a number \( p \) is prime if \( p > 1 \) and for every integer \( d \) such that \( 1 < d < p \), \( d \) does not divide \( p \).
If start is greater than end, or if there are no prime numbers in the given range, output an empty line.
inputFormat
The input consists of a single line containing two integers start
and end
separated by a space.
outputFormat
Print the prime numbers between start
and end
(inclusive) in ascending order, separated by a space. If there is no prime number in the range, print an empty line.
10 30
11 13 17 19 23 29
</p>