0
how to write a code in cpp that determines whether the input integer is prime number or not??
2 Answers
+ 4
Prime numbers are ones that are divisible only by 1 and itself. Use this as the condition to check. The number that can be divisible means its remainder is 0. Give the hints above and you can try to program it by yourself.
+ 1
Go to Code Playground and use the search feature using 'prime' as search term, you will find loads of examples to learn from š