c - Code not executing -
i solving basic c exercises. following code, when written, failed execute. can suggest why?
#include <stdio.h> int main() { int = 4, j = -1, k = 0, w, x, y, z; w = || j || k; x = && j && k; y = || j && k; z = && j || k; printf("w=%d x=%d y=%d z=%d", w, x, y, z); return 0; }
p.s. no errors being shown, execution window doesn't open.
the reason nothing seems happening execution window doesn't hang around after application terminates, , application executes never chance see window before it's gone.
one way work around insert code reads input before application exits:
#include <stdio.h> int main() { int = 4, j = -1, k = 0, w, x, y, z; w = || j || k; x = && j && k; y = || j && k; z = && j || k; printf("w=%d x=%d y=%d z=%d", w, x, y, z); /* want \n here. */ getchar(); return 0; }
Comments
Post a Comment