Question: Find Prime Numbers Given an integer, find whether the numbers is a Prime number or not. Write a function: int isPrime(int number) that accepts an

Find Prime Numbers

Given an integer, find whether the numbers is a Prime number or not.

Write a function: int isPrime(int number) that accepts an integer number.

The isPrime function returns 1 if number is prime else 0.

Input: 11

Output: 1

EX: 11 can be divided exactly by 1 and 11. Hence it's a prime number.

Assume that, number is integer within the range [ 2,147,483,64 to 2,147,483,64 ].

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!