vendredi 22 novembre 2019

Why is (n = 0) == 0?

Can somone please explain me whats the reason behing this code and why does it print b

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    n = 0;
    if (n = 0)
        printf("a \n");
    else
        printf("b \n");
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire