While Loops
5 / 5
All prime numbers
Input an integer n
.
Print all prime numbers from 2 to n
separated by spaces.
For example, if n=17
then the output is 2 3 5 7 11 13 17
.
Input an integer n
.
Print all prime numbers from 2 to n
separated by spaces.
For example, if n=17
then the output is 2 3 5 7 11 13 17
.