New Year Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

C++ Institute C++ Institute Certification CLA-11-03 New Questions

Page: 3 / 3
Total 40 questions

CLA - C Certified Associate Programmer Questions and Answers

Question 9

What happens if you try to compile and run this program?

#include

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

int i = 7 || 0 ;

printf("%d", !! i);

return 0;

}

Choose the right answer:

Options:

A.

The program outputs -1

B.

The program outputs 7

C.

Compilation fails

D.

The program outputs 1

E.

The program outputs 0

Question 10

-

What happens if you try to compile and run this program?

#include

int *f();

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

int *p;

p = f();

printf("%d",*p);

return 0;

}

int *f() {

static v = 1;

return &v;

}

Choose the right answer:

Options:

A.

The program outputs 1

B.

Compilation fails

C.

The program outputs 3

D.

The program outputs 2

E.

The program outputs 0

Question 11

Assume that ints are 32-bit wide.

What happens if you try to compile and run this program?

#include

typedef struct

int i;

int j;

int k;

} str;

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

str s = { 7, 7, 7 };

printf ("%d", sizeof (s.s));

return 0;

}

Choose the right answer:

Options:

A.

Execution fails

B.

The program outputs 16

C.

Compilation fails

D.

The program outputs 12

E.

The program outputs 4

Question 12

What happens when you compile and run the following program?

#include

#define SYM

#define BOL 100

#undef SYM

int main (void) {

#ifdef SYM

int i = 100;

#else

int i= 200;

#endif

int j = i + 200;

printf("%d",i+j);

return 0;

}

Select the correct answer:

Options:

A.

The program outputs 200

B.

The program outputs 100

C.

The program outputs 400

D.

The program outputs 300

E.

The program outputs 600

Page: 3 / 3
Total 40 questions