Search for:
Jump to: 
Your Ad Here
Post new topic Reply to topic
Author Message
 Post subject: Simple code to generate tables(multiplications)
PostPosted: Wed Jun 29, 2011 1:15 pm 
Offline

Joined: Wed Jun 29, 2011 11:44 am
Posts: 23
Hi friends,
This will help you to generate tables such as 2 table 3 table etc

<html>
<head>
<script type="text/javascript">
var num1,num2,k;
function getdata()
{
num1=parseInt(prompt("Please enter the start point"));
num2=parseInt(prompt("Please enter the end point"));

for(k=1;k<=10;k++)
{
document.write(num1,"*",k,"=",(num1*k));
document.write("</br>")
if(k==10)
{
if(num1==num2)
break;
else{
k=0;
num1++;
continue;
}
}
}
}

</script>
</head>

<body>
<h5>Displaying tables</h5>
<input type="button" value="input" onclick="getdata()"/>
</body>
</html>

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic    [ 1 post ] 

1, 2, 3, 4, 5 ... 413
Recent topics  Replies   Views   Last post 
No new posts Ecommerce website development and website Design

by iweballey » Fri May 17, 2013 7:15 am in PHP-Code Help

0

126

Fri May 17, 2013 7:15 am

iweballey View the latest post

No new posts How to upgrade and migrate Joomal site

by mallikharjuna rao » Mon Jan 21, 2013 1:40 pm in Joomla

1

344

Thu May 16, 2013 9:53 am

sunitha12 View the latest post

No new posts Benefits of PHP

by hirephpexpert » Fri Sep 07, 2012 4:41 am in CakePHP

6

1567

Wed May 15, 2013 6:25 am

PrettyPrincesG View the latest post

No new posts How to stop user from getting registered in Joomla

by mallikharjuna rao » Tue Jan 22, 2013 5:16 am in Joomla

3

1475

Wed May 15, 2013 6:17 am

PrettyPrincesG View the latest post

No new posts How to write a query in social engine

by fathima_sony » Tue Sep 06, 2011 12:34 pm in Others

2

1755

Tue May 14, 2013 12:09 pm

sanath123 View the latest post


Your Ad Here