Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. For the following questions, choose the corret answer. (a) Given the following C code: #include #include int main(int argc, char **argv) { argc--; for(int

4. For the following questions, choose the corret answer.

(a) Given the following C code:

#include

#include

int main(int argc, char **argv) {

argc--;

for(int i = 0; i < argc; i++) {

printf("%s ", argv[i]); }

return 0; }

Which output will be displayed if executed as follows:

./a.out Doctor Who?

A. Doctor Who?

B. Doctor C. a.out Doctor

D. ./a.out Doctor

E. ./a.out Doctor Who?

F. None of the above

(b) What would be the output of the following piece of C code? Assume that the rest of the code is valid (i.e., proper headers have been included, variables have already been properly declared, and the code compiles, etc.)

i = 3;

j = 4;

i = (i == j) ? 5: 7;

printf("i is now %d ", i);

A. i is now 1

B. i is now 3

C. i is now 4

D. i is now 5

E. i is now 7

F. None of the above.

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

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions

Question

The company openly shares plans and information with employees.

Answered: 1 week ago