Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active October 20, 2021 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/61631cd1b7a6fccf336a71301fcd1568 to your computer and use it in GitHub Desktop.
Save McLarenCollege/61631cd1b7a6fccf336a71301fcd1568 to your computer and use it in GitHub Desktop.
Exercise : Prime Numbers from a to b

Given two numbers a and b, you have to print all the prime numbers between them (including them). Note: a will always be less than b. Note: You have to reuse the checkPrime function created earlier

function printPrime(a,b){
// write your code here
}

let a = 17;
let b = 30;
printPrime(a,b);

//output should be /* 17 19 23 29 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment