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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -