lundi 29 mai 2017

When condition inside if statement is fractional

void main(void)
{
    int i;
    for(i=1;i<=5;i++)
    {
if(i/5)
    continue;
        printf("%d",i);
}
}

My simple query is,if the condition inside "if" is evaluated to a fraction,is it treated as 0?As here the output is 1234,so when condition is 1/5,2/5,3/5,4/5 it is prinnting values of i,when 5/5=1 it is executing continue statement.

Aucun commentaire:

Enregistrer un commentaire