मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (सामान्य) इयत्ता १२ वी

Write event driven JavaScript program for the following. Find and display factorial of given number. - Information Technology

Advertisements
Advertisements

प्रश्न

Write event driven JavaScript program for the following.

Find and display factorial of given number.

थोडक्यात उत्तर

उत्तर

Coding:

<html>
<script type="text/javascript">
var n=4,i,f=1;
for(i=n;i>= 1;i--)
{
f=f*i;
}
document.write("<br>Factorial of 4 is"+f);
</script>
</html>
shaalaa.com
DOM (Document Object Model)
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Advanced Javascript - Exercises [पृष्ठ ५२]

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×