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
In C, when you declare an array like int arr[10], what does the array name 'arr' represent?
What is the size of the string 'Hello' when stored in a character array with null terminator?
Which of the following correctly initializes a 2D array of integers?
In the declaration char *str[5], what does the array represent?
How many elements can be stored in a 2D array declared as int matrix[4][5]?
What is the correct way to declare and initialize a string in C?
What is the output of: int arr[] = {10, 20, 30}; printf("%d", *(arr+1));?
What will be the size in bytes of int arr[5] on a 32-bit system?
Consider the following code: char str[] = "HELLO"; int len = 0; while(str[len] != '\0') { len++; } printf("%d", len); What will be the output?
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?
Which of the following is NOT a valid pointer declaration?
Identify the output: char *str = "Hello"; printf("%c", *str);
A pointer variable stores the _____ of another variable.
What is the size of a pointer variable on a 32-bit system?
Consider: int x = 10; int *p = &x; What does the expression *p represent?
Which operator is used to get the address of a variable?
What will be printed by the code: char *ptr = "Hello"; printf("%c", *ptr);
What is the size of a pointer variable in a 64-bit system?