Question: We want you to assist mathematicians by writing a program that will check if 2 numbers are Twin Primes or not. 1 . Your program
We want you to assist mathematicians by writing a program that will check if
numbers are Twin Primes or not.
Your program should start by asking for the numbers.
First check if the input numbers are prime.
If not, say which number is NOT prime, and keep 'looping' till a
valid prime number is entered see execution sample below.
It is advised to define a function isPrime that returns
true if the number is prime and false otherwise.
It is not mandatory to implement an isPrime function. You
can write its equivalent code ie the while loop where you
check for divisors
If both numbers are prime, then check if they are twins, ie p p
We want your program to keep executing till the user wants to stop it
eg by answering a choice question yn To do so ember your code in
a while loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
