A prime number is a natural number that is greater than 1 and cannot be formed by multiplying two smaller natural numbers.
Given a range start and end, we have to print all prime numbers between start and end (including start and end).
Example:
Input:
start = 1
end = 100
Output:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
Program to find prime numbers in a given range in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer