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 |
Describe javascript and vbscript.
What are the concepts of object oriented programming?Explain with an example.
What is the difference between undefined and not defined in JavaScript?
Why javascript is so popular?
How much do javascript programmers make?
How do I find javascript?
What is a reverse string?
What is scope chain in javascript?
What is a “closure” in JavaScript? Provide an example
java pgme for class members hours:minutes:seconds then the constructor expects milliseconds as assignment and initialize data members the members function print hh:mm:ss 90,000 milliseconds passed in constructor then the output is 00:01:30
Why is object naming important to use in javascript?
How to hide javascript code from old browsers that dont run it?