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 a closure javascript? Explain
What is an Event Bubbling in Javascript?
What is null variable?
What are escape characters in javascript?
What is object cloning
Explain window.onload and ondocumentready?
Entire content of a JavaScript source file in a function block?
Explain how can you submit a form using JavaScript?
What are the different types of errors available in javascript?
hi iM rahul.my questions is my project is a web based & developed using java,jsp. when i record it using qtp what script i will get like either browser("jdfjkf").page("nkf").... or javawindow("f d ").javaedit("Dasf").... plz clarify my doubt asap and i also need some vbscipt of java coding?
List some unit testing frameworks javascript
How do you trim in javascript?