This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Write a JS program to check given number is perfect number or not. | |
2. Write a JS program to check given number is Armstrong number or not. | |
3. Write a JS program to check given number is prime number or not. | |
4. Write a JS program to check given number is strong number or not. | |
5. JS program to check a number is odd or even. | |
6. Write a JS program to check given number is palindrome number or not. | |
8. Write a JS program to check given string is palindrome number or not. | |
7. Write a JS program to solve quadratiJS equation. | |
8. Write a JS program to print Fibonacci series of given range. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var input=prompt("Enter a value"); | |
var v=input; | |
var count=0; | |
for(var i=1; i<input; i++) | |
{ | |
if(input%i==0) | |
{ | |
count=count+i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var e,x,d=0; | |
var b=prompt("Enter a number"); | |
x=b; | |
while(x>0) | |
{ | |
e=x%10; | |
d=d+(e*e*e); | |
x=parseInt(x/10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a=prompt("enter a value"); | |
var count=0; | |
for(var i=2;i<a;i++) | |
{ | |
if(a%i==0) | |
{ | |
count=i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a=prompt("Enter a value"); | |
z=a; | |
e = d = 0; | |
while(z > 0) | |
{ | |
e = z % 10; | |
d = d + fact(e); | |
z = parseInt(z/10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a=prompt("Enter a value"); | |
if(a%2==0) | |
{ | |
alert("Given number is even"); | |
} | |
else { | |
alert("Give number is odd"); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a = prompt("Enter Value"); | |
b = a.toString(); | |
rev = b.split("").reverse().join(""); | |
if(a == rev) | |
{ | |
alert("Palindrome"); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i; | |
var fib = []; | |
fib[0] = 0; | |
fib[1] = 1; | |
for(i=2; i<=10; i++) | |
{ | |
fib[i] = fib[i-2] + fib[i-1]; | |
} | |
alert(fib); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a = prompt("Enter"); | |
var f = 1; | |
for (var c = 1; c <= a; ++c) f *= c; | |
alert(f); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var tempStr = "",prevNumber=1,i,depth=10; | |
for(i=0;i<depth;i++){ | |
tempStr = "";j=0; | |
while(j<= i){ | |
tempStr = tempStr + " " + prevNumber; | |
j++; | |
prevNumber++; | |
} | |
console.log(tempStr); |
OlderNewer