Vidyalelo
C++ Programming · Q72

Variables and Data Types in C++

Programming · C++ Programming · question 72

Q72

What will be the output of the following C++ code? #include using namespace std; int main() int i = 3; int l = i / -2; int k = i % -2; cout << l << k; return 0;

A.
compile time error
B.
-1 1
Answer
C.
1 -1
D.
implementation defined

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board