HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <h1>JS Composite Number</h1> <script> var num = 12; var i = 1; var count = 0; while(num >= i) { if(num % i == 0) count++; i++; } if(count > 2) document.write(num +" is a composite number"); else document.write(num +" is not a composite number"); </script> </body> </html>
OUTPUT
×

Save as Private