In Association with Amazon.in   Flipkart

Friday, July 12, 2013

JavaScript Nested If Example

Nested If: if inside another if Statement.

    <script>
                a = 30;
                b = 20;
                c = 45;
               if(a>b)
{
if(a>c)
 document.write(a + ' is big');
else
document.write(c + ' is big');
}
  else
{
if(b>c)
document.write(b + ' is big');
else
document.write(c + ' is big');
}               

                </script>

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...