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>
<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