Day 39: Prime Number or not of 100DaysCodingChallenge
Hello all,
I have started the 100 days of coding challenge to improve my programming skills..
Today is the Day39 of 100DaysCodingChallenge for
to check whether an input Number taken by the user is a Prime Number or not.
Code :
let a = prompt("Enter a : "); if (a % a == 0 && a % 1 == 0) { console.log(a, "Number is a Prime Number."); } else { console.log(a, "Number is not a Prime Number."); }
Output :
Happy Coding:)
Thank you...
Comments
Post a Comment