Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language is in C What is the value of sizeof(x) if x is a pointer to int? The number of bytes taken by a pointer

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedLanguage is in C

What is the value of sizeof(x) if x is a pointer to int? The number of bytes taken by a pointer to int The value 1000. O The size of the object pointed by x. O It's illegal C. One can write -inn-flint + hutnat sizeof(x). If p is of type int *, are these checks equivalent? * * * if (p == NULL) return -1; /* (a) */ if (p == 0) return -1; /* (b) */ if (!p) return -1; /* (c) */ * O None is equivalent to any other. o Only (a) and (b) are equivalent. Incorrect. Only (a) and (c) are equivalent. Only (b) and (c) are equivalent. They are all equivalent. What does the following code print? #include void print Comparison (void) { int x; if (sizeof(x+x) != sizeof(int)) printf("different "); else printf ("equal "); int main(void) { print Comparison (); return 0; The code does not compile. Incorrect It crashes. It prints "equal." It prints "different." What is printed depends on the machine on which the code is run. What function of x and y does the following f compute? int f(int x, int y) { if (x == 0) return 0; return y + f(x-1, y); Assume that x is nonnegative. O The product of x and y. It does not terminate. Hence it computes no value. Incorrect It adds x and y. o It raises y to the power x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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