What will be the output of the following C code? #include<stdio.h> int main(){ int x; int i = 5; int l = i /-2; int k = i % -2; printf("%d %d\n", l…

What will be the output of the following C code?

#include<stdio.h>
int main(){
    int x;
    int i = 5;
    int l = i /-2;
    int k = i % -2;
    printf("%d %d\n", l, k);
    x = 5 % 1;
    printf("%d\n", x);
    return 0;
}
  1. a) -2 1
  2. b) -1 1
  3. c) 1 -1
  4. d) Implementation defined

From the BUET MSC (ICT) July 2021 – MCQ exam, question 26 of 57.

More from this paper