Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Surprise.c: #include int main({ // OK, nothing is wrong with this printf(-1 and -2, which is bigger? >> %s , (-1 > -2) ?-1:-2); //

image text in transcribed
Surprise.c: #include int main({ // OK, nothing is wrong with this printf("-1 and -2, which is bigger? >> %s ", (-1 > -2) ?"-1":"-2"); // OK, nothing is wrong with this printf("-1 and 2, which is bigger? >> %s ", \ (-1 > 2)?"-1":"2"); // What??? printf("-1 and 0, which is bigger? >> %s ", (-1 > OU)?"-1":"OU"); printf("-1 and 99999, which is bigger? >> %s ", (-1 > 99999U) ? "-1":"99999U"); } Question 1: What is odd about the results printed out by the program? Question 2: Why would this program behave this way

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions