What happens if you try to compile and run this program?

Last Updated on April 30, 2022 by Admin 2

What happens if you try to compile and run this program?

#include <stdio.h>

int main(void)
{
   int i, j, k;

       i = 0;
 j = 0;

       if(i)
       j--;
else
       i++
if(i)
       i--;
else
       j++;
       k = i + j;

       printf("%d", k);
return 0;
}
  • the program outputs0
  • the program outputs1
  • the program outputs2
  • the program outputs-1
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments