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 is the real name of JavaScript?
Some XYZ company is arranging for online aptitude tests. Draw detailed E-R diagram for the same..
How can a particular frame be targeted, from a hyperlink, in javascript?
Is javascript or python easier?
Describe javascript and vbscript.
What is the importance of javascript?
Why is javascript dangerous?
What is a “closure” in JavaScript? Provide an example
What is a closure in javascript?
what does javascript null mean?
How can you create an Array in JavaScript?
What is the need of javascript?