The following two similar codes are giving different outputs.
The following code:
Code:
for (i=1;i<=10;i++)
{
if ((i%2)!=1)
{
i;
}
}
returns the expected answer, whereas the code
Code:
for (i=1;i<=10 && (i%2)!=1;i++)
{
i;
}
returns nothing.
Is this expected behaviour?
-- VInay
The following two similar codes are giving different outputs.
The following code:
[code]
for (i=1;i<=10;i++)
{
if ((i%2)!=1)
{
i;
}
}
[/code]
returns the expected answer, whereas the code
[code]
for (i=1;i<=10 && (i%2)!=1;i++)
{
i;
}
[/code]
returns nothing.
Is this expected behaviour?
-- VInay