Loading
View RSS Feed

sachdev

How To Print Pattern 123456 Using Javascript?

Rating: 3 votes, 5.00 average.
snap.bmp





Code:



<html>
<body bgcolor="blue">
<script type="text/javascript">
var i,j,k,x=1;
for(i=1;i<=3;i++)
{
for(j=1;j<=3-i;j++)
document.write("&nbsp");
for(k=1;k<=i;k++)
{
document.write(x++);
document.write("&nbsp");
}
document.write("<br>");
}
x=1;
for(i=1;i<=2;i++)
{
for(j=1;j<=i;j++)
document.write("&nbsp");
for(k=1;k<=3-i;k++)
{
document.write(++x);
document.write("&nbsp");
}
x=0;
document.write("<br>");
}
</script>

</body>
</html>

Submit "How To Print Pattern 123456 Using Javascript?" to Digg Submit "How To Print Pattern 123456 Using Javascript?" to del.icio.us Submit "How To Print Pattern 123456 Using Javascript?" to StumbleUpon Submit "How To Print Pattern 123456 Using Javascript?" to Google

Updated 12-04-2011 at 06:00 PM by Harsh

Categories
Web Design

Comments




Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.