Program to find the prime no. between the given range

The program to find  prime no. there are many logic to do but i used the nested loop to do it as it is easiest method.We initialize the require variable and do the next step.Here n is the variable to store the input number by the user.If the user want to find the prime no. between 1 to 100 then n should be 100.Next it will check the condition if it is true then it go on next loop and it will check the condition again.If the condition is true then it come to the (if) statement and it check for the prime no.Here if c=2 then the no. is prime and it will print otherwise not.
Here the user input n=100.Hence it print the prime no between the range of 1to100 as see above.  

Comments

Popular posts from this blog

Programme to find the longest word in the sentence

Programme to find sum and difference between two number