An integer n is prime if its only factors are 1 and itself. Write a code segment for checking whether the value of an int n is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 5

An integer n is prime if its only factors are 1 and itself. Write a code segment for checking whether the value of an int n is

27th Dec 2021, 7:26 PM
Sweshthika Sureshkumar
Sweshthika Sureshkumar - avatar
2 Answers
+ 4
Make your attempt and attach your code so we can help you!
27th Dec 2021, 7:28 PM
CGM
CGM - avatar
+ 1
Just like Cristian wrote, You need to try and approach this problem by yourself first and if You get really stuck, we'll try to help you, but it cannot work on a basis of you stating the problem's parameters and us doing the coding for you. Let's respect each other's time.
27th Dec 2021, 8:52 PM
Nick