iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.241Medium

What is the output? int a = 5; int *p = &a; int q = &p; printf("%d", q);

Q.242Medium

What happens when you increment a pointer? int arr[5] = {1,2,3,4,5}; int *p = arr; p++;

Q.243Medium

What is the output? int x = 10, y = 20; int *p = &x; int *q = &y; p = q; printf("%d", *p);

Q.244Medium

What will be printed? int arr[] = {1, 2, 3}; int *p = arr; printf("%d", *(p+2));

Q.245Medium

What is a wild pointer?

Q.246Medium

What is the output? int *p = NULL; if(p) printf("Not NULL"); else printf("NULL");

Q.247Medium

Which of the following correctly allocates memory for 10 integers?

Q.248Medium

What is a dangling pointer?

Q.249Medium

What will be the output? int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", arr[1], *(p+1));

Q.250Medium

A void pointer can be used to store addresses of variables of any data type. However, it must be cast before dereferencing. Which statement about void pointers is FALSE?

Q.251Medium

Consider the code: int arr[] = {5, 10, 15, 20}; int *ptr = arr; ptr++; What does ptr now point to?

Q.252Medium

Which of the following best describes a dangling pointer situation?

Q.253Medium

Consider: int x = 5; int *p = &x; int q = &p; What is the value of q?

Q.254Medium

Which memory allocation function does NOT initialize allocated memory to zero?

Q.255Medium

Consider: int arr[5] = {1, 2, 3, 4, 5}; int *p = arr; What is the value of *(p+2)?

Q.256Medium

A function needs to modify a variable in the calling function. Which parameter passing method is appropriate?

Q.257Medium

Consider: void func(int *arr, int size); This function prototype suggests that func will:

Q.258Medium

What will be the output of: int x = 10; int *p = &x; printf("%p", p); (assuming typical system output)

Q.259Medium

What is the difference between pointer and array name in C?

Q.260Medium

What will be the output? int a[] = {10, 20, 30}; int *p = a; printf("%d", *(p+2));