vendredi 19 août 2016

Why else block is executed if num1, num2, and 0 at the end is assigned to if block?

In this code

#include <stdio.h>
int main(){
    int i;

    if(i= 50,40)
        printf(" if blk i %d\n",i);
    else
        printf(" else part" );



    return 0;
}

the output comes as

if blk i 50

but when a zero is added to the assignment part in if statement, it goes to the else part. Why is this 0 making it go to else part?

Aucun commentaire:

Enregistrer un commentaire