3. (C) Write a JavaScript program to display all the prime numbers between 1 and 100.
<html> | |
<head> | |
</head> | |
<body> | |
<h1>PRIME NUMBERS BETWEEN 1 AND 100.</h1> | |
<script> | |
var array = new Array(100); | |
for (var i=2 ; i<=array.length-1; i++) { | |
if((i%2===0) || (i%3===0)) | |
continue; | |
document.write(i+" ,"); | |
} | |
</script> | |
</body> | |
</html> |
3. (C) Write a JavaScript program to display all the prime numbers between 1 and 100.
Reviewed by admin
on
December 24, 2019
Rating:
No comments: