Question

QUESTIONS What will be the output of the following C code? 1. #include <stdio.h> int maino int 1 - -3; int k - * % 2; printf(
1 1
Add a comment Improve this question Transcribed image text
Answer #1

The value stored in the variable i = - 3

Then the variable k stores the value k = i % 2 = (-3) % 2 = -1 (First divide 3 by 2. The remainder is 1. But the first operand that is -3 has a negative sign so the result will be -1)

Since the variable k stores the value (-1), hence the output of the program when it is executed will be (The printf command is used to print the value of k)

- 1 .........................(Correct Answer)

Add a comment
Know the answer?
Add Answer to:
QUESTIONS What will be the output of the following C code? 1. #include <stdio.h> int maino...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT