-
-
Save phaya/60828f76620fbb41a469 to your computer and use it in GitHub Desktop.
El siguiente programa imprime que "n es igual a 10" pero n se toma como valor inicial 2 ¿qué está pasando?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int n = 2; | |
if (n = 10) { | |
printf("n is equal a 10\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes! El resultado de la asignación
n=10
es lo que evalúa el ìf`, y como 10 != 0 resulta verdadero