C++ Institute CLA - C Certified Associate Programmer CLA-11-03 Question # 6 Topic 1 Discussion

C++ Institute CLA - C Certified Associate Programmer CLA-11-03 Question # 6 Topic 1 Discussion

CLA-11-03 Exam Topic 1 Question 6 Discussion:
Question #: 6
Topic #: 1

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

#include

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

char *t = "abcdefgh";

char *p = t + 2;

int i;

p++;

p++;

printf("%d ", p[2] - p[-1]);

return 0;

}

Choose the right answer:


A.

The program outputs 3


B.

The program outputs 4


C.

Execution fails


D.

The program outputs 2


E.

Compilation fails


Get Premium CLA-11-03 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.