ProgrammingModerate
int v = 10; int *p = &v; int **q = &p; **q += 5; printf("%d", v); What is printed?
- A. 15
- B. 10
- C. 5
- D. 20
Correct answer: A. 15
q holds &p, so *q is p and **q is v itself; **q += 5 updates v from 10 to 15. 10 assumes only a copy was changed through the pointers, and 20 doubles the value.
More C Programming questions
- printf("%d", sizeof(int[4]) / sizeof(int)); What is printed with 4-byte int?
- printf("%d", (int)(0.1 + 0.2 == 0.3)); What is printed in IEEE double arithmetic?
- printf("%d", 'a' < 'b' && 'b' < 'c'); What is printed?
- printf("%d %d", 5 / 2, -5 / 2); What is printed in C99?
- What is printed? c #include <stdint.h> #include <stdio.h> int main(void) { uint32t v = 0x00F0F0A5u; v = v - ((v >> 1) & 0x55555555u); v =…
- What is printed? c #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void a, const void b) { const char x = (const…