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
What does the & operator do when used with a variable?
What is the output of the following code? int x = 20; int *p = &x; printf("%d", *p);
Which of the following is a void pointer?
What is the output of the following code? int x = 5; int *p = &x; int q = &p; printf("%d", q);
What will be the size of the pointer variable on a 64-bit system? int *ptr;
What is the output? int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", *(p+1), arr[1]);
What does void *ptr represent?
What is the output? void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int x = 5, y = 10; swap(&x, &y); printf("%d %d", x, y);
What is the output? char str[] = "ABC"; char *p = str; printf("%c", *(p+2));
What is the size of a pointer in a 64-bit system?
How does free() handle a NULL pointer?
What is the result of: int x = 5; int *p = &x; int *q = p; if p == q?
What happens with: int arr[10]; int *p = arr; *p = 5; printf("%d", arr[0]);?
What is the output of the following code? int x = 10; int *p = &x; int q = &p; printf("%d", q);
Consider the declaration: const int *p; and int * const q; Which statement is TRUE?
What is the primary issue with this code? int *p; *p = 10;
What is the primary difference between a structure and a union in C?
What will be the output of sizeof(union test) if union has members: int a, char b, float c?
Which keyword is used to define a structure in C?
What is the size of the following structure? struct point { int x; int y; float z; };