Sunday 14 April 2013

4. Write a JavaScript that finds out multiples of 10 in 0 to 10000. On the click of button start the timer and stop the counter after 10 seconds. Display on the screen how many multiples of 10 are found out within stipulated time.

WTAD Practical-4
Write a JavaScript that finds out multiples of 10 in 0 to 10000. On the click of button
start the timer and stop the counter after 10 seconds. Display on the screen how
many multiples of 10 are found out within stipulated time.



<HTML>
<HEAD>
<TITLE>WTAD.practical-4 @iAmLearningHere </TITLE>
</HEAD>

<script type="text/javascript">
    function start()
    {
        setTimeout("displayMultiple()", 10000); // time in millisecond
    }

    function displayMultiple()  
    {
        var i = 1;
        document.write(" [ ");
        for(i=1; i<=10000; i++)
        {
            if(i%10==0 )
                document.write(i + ' , ');
        }
        document.write(" ] ");
    }
</script>


<BODY>
<FORM>
    <input type="button" name="btStarter" value="Click To Start" onclick="start()"/>
</FORM>
</BODY>
</HTML>


WTAD practical 4
For all WTAD programs wtad-pra cticals.html
To get all programs in your inbox.Enter your email

Kindly Bookmark and Share it:

0 comments :

Post a Comment

Any Query ? any suggestion ? comment here

 

Recent Post

Recent Comments

© 2010 IamLearningHere Template by MBT