How to write a program that will print all the prime number between 1 to n?
I can write the program to check whether a number is prime or not but I want to write a program that will print all prime number. Here I will take the input value n from keyboard. Example: If n = 10 than the output sceen will print: 2 3 5 7 (as 1 is not a prime number).