HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <h1>JS Composite Number</h1> <script> var num = 12; var i = 1; var count = 0; do { if(num % i == 0) count++; i++; }while(i<= num); 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