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
Which operator is used to get the address of a variable in C?
What will be the size of a pointer variable on a 64-bit system?
What is a NULL pointer?
What is the output? int a = 5; int *p = &a; int q = &p; printf("%d", q);
What happens when you increment a pointer? int arr[5] = {1,2,3,4,5}; int *p = arr; p++;
Which of the following is NOT a valid pointer declaration?
What is the output? int x = 10, y = 20; int *p = &x; int *q = &y; p = q; printf("%d", *p);
Identify the output: char *str = "Hello"; printf("%c", *str);
What is the difference between *p++ and (*p)++?
What will be printed? int arr[] = {1, 2, 3}; int *p = arr; printf("%d", *(p+2));
What is a wild pointer?
What is the output? int *p = NULL; if(p) printf("Not NULL"); else printf("NULL");
Which of the following correctly allocates memory for 10 integers?
What is a dangling pointer?
What does the following code do? int *p = (int*)malloc(sizeof(int)); *p = 5; free(p); p = NULL;
What will be the output? int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", arr[1], *(p+1));
Which statement is true about void pointers?
What is the output? int x = 50; int *p = &x; int *q = p; q = NULL; printf("%d", *p);
A pointer variable stores the _____ of another variable.
What is the size of a pointer variable on a 32-bit system?