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 is the correct way to declare a 1D array of 10 integers in C?
What will be the output of strlen("Hello") in C?
Which of the following is NOT a valid string initialization?
What does the following code do? strcpy(dest, src);
Consider a 2D array declared as: int matrix[3][4]. How many elements does it have?
If an integer array arr[10] is declared globally in C, what will be the initial values of its elements?
In C, a string is internally represented as:
How much memory is allocated for char name[50] declaration?
What is the time complexity of accessing an element at index 5 in an array?
What does strlen() function return for the string "C2025"?
What will be the output of the following code? int arr[] = {1, 2, 3, 4, 5}; printf("%d", *(arr + 3));
Which of the following correctly declares a 2D array of strings?
What is the output of strlen("Hello") in C?
How many bytes are allocated by: int arr[10][20];?
What will be printed? char *str = "Hello"; printf("%c", str[1]);
Predict the output: int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; printf("%d", arr[1][2]);
What is the output? int arr[] = {10, 20, 30, 40}; int *p = arr; printf("%d", p[2]);
What is the maximum size of a string that can be stored in char str[50]?
Which function is used to find the length of a string in C?
How many bytes does a 2D array int arr[3][4] occupy in memory?