the output is showing 3 as prime and all other numbers in the range as composite.
To find prime numbers between 2 and a specified number as input
@Abhiparas hey abhishek first of all tell me what you are trying to do in this code then I can help you asap.
i want to print all the prime numbers between 2 and a given number which will be given as input by the user
what is wrong in the code please reply!!
please reply!!!
Hi, you have to find prime numbers so you have to change the code a bit & reshift the approach.
First, you have to take input n (number till you want to print prime numbers). Then, we have to check for every number that it’s prime or not & printing the prime number itself rather than the text (“Prime”).
can you modify the code and give the link to me?
I updated the code, I hope this will help.
If you have any other doubt feel free to ask.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.