Program to find difference between prime numbers in a range | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Program to find difference between prime numbers in a range

10th Aug 2018, 11:46 AM
athik
5 Answers
+ 1
athik rehman ok, well then you should just make a function to check if the numbers are prime by checking if they have any divisors up to their square root, and if both the inputted numbers are prime, output their difference
10th Aug 2018, 11:55 AM
hinanawi
hinanawi - avatar
+ 1
athik rehman no, if i make the code for you, you don't really learn anything
10th Aug 2018, 11:59 AM
hinanawi
hinanawi - avatar
0
by difference to you mean just subtracting them all from one another?
10th Aug 2018, 11:51 AM
hinanawi
hinanawi - avatar
0
if input is 2 primes then output should be difference of them
10th Aug 2018, 11:54 AM
athik
0
hinanawi thank u , can u insert code
10th Aug 2018, 11:58 AM
athik