Computer Science, asked by gunu6, 1 year ago

WAP to enter a nomber and check whether it is a prime number or not

Answers

Answered by AbhinashDutta
2
Use for loop to check whether the entered no. is equal to 2,3,5 and 7, each if condition in the pevious if condition. If n / 2!=0 ,check if n/3!=0, then check if n/5!=0 amd then if n/7!=0. If reached till seven then print "yes" or if stops in between print "no".
Similar questions