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 four types of javascript objects?
Is javascript used for backend?
How is it possible to get the total number of arguments that are passed to a function?
Write a program in Java to display the IP address of the local and remote machine.
0 Answers Annamalai University,
What is scope javascript?
What is the difference between script type and the script language attributes?
What is postback in javascript?
what is the source code for sendRedirect method()java Servlet program?
How many types of data types are there?
What are the valid scopes of a variable in JavaScript?
In javascript chained select menus are available.first select menu is worked and others are disabled.when we select any one option then the next select menu will worked having option releated to selcted in first select menu.How it possible? what is the coading of this programme?
Can you put javascript in html?