Question

Question 2 Predict the output of the following program: #include <stdio.h> void mainot printf(%d %d %d 10 > -1, (unsigned)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1)

OUTPUT: 1 0 1

In the print statement we have three digits that will be printed.

For the first 10 > -1 returns true which when converted into digit gives 1. The conversion to digit occurs becuase we have used %d.

For the second (unsigned)10 > -1 returns false which when converted into digit gives 0. The conversion to digit occurs becuase we have used %d.

For the second (unsigned)(10 > -1) returns true which when converted into digit gives 1. The conversion to digit occurs becuase we have used %d.

CODE AND OUTPUT SCREENSHOT

main.c 1 #include<stdio.h> 2 3 void main(){ 4 printf(%d %d %d, 10 > -1, (unsigned) 10 > -1, (unsigned) (10>-1)); 5} 6 7 inp

Add a comment
Know the answer?
Add Answer to:
Question 2 Predict the output of the following program: #include <stdio.h> void mainot printf("%d %d %d"...
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