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
How many times will the following loop execute? int arr[5]; for(int i=0; i<5; i++) arr[i]=0;
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?