write a program to generte a harmonic series
1+1/2+1/3+1/4+1/5 upto 15 terms.
Answer / upendar
<html>
<head>
<script type="text/javascript">
function hormonicSeries() {
for(var i=1;i<=15;i++) {
if(i == 1) {
var addSeries = 1/i;
} else {
for(var j=2; j<=15;j++) {
if(i == j) {
addSeries = addSeries +"+1/"+i ;
}
}
}
}
var series = addSeries;
document.write(series);
}
</script>
</head>
<body onload="hormonicSeries();">
</body>
</html>
| Is This Answer Correct ? | 4 Yes | 3 No |
What are the boolean operators supported by javascript? And operator: &&
what is the need of javascript in the internet
Can you explain the difference between call and apply?
what is the difference between window & document in javascript?
How do we get javascript onto a web page?
write a programme to solve a formula for compound interest using html tags. I want to know how a formula containing degree (raise to the power) can be solved.
What is javascript used for on iphone?
What are the advantages of using JavaScript?
What are the different types of errors supported by javascript?
Can I declare a variable as CONSTANT in JavaScript?
How would you check if a variable is null/undefined?
can wwe trace a java program (class)