Computer Knowledge - MCQ Practice Questions
Practice free Computer Knowledge multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.
309 questions | 100% Free
Which of the following is a correct way to initialize a pointer to NULL?
What is the output of the expression: * 3 in C?
What is the correct syntax to pass a 2D array to a function in C?
What will be printed by: int x = 5; printf("%d", ++x + x++);?
Which of the following correctly uses the ternary operator?
What is the purpose of the const keyword when used with a pointer?
What is the return type of malloc() function?
In the expression: int arr[10]; what is arr[5]?
What is the output of: int a = 10, b = 20; int *p = &a, *q = &b; printf("%d", *p + *q);?
What is the output of: int x = 5; int y = ++x; ?
What is the purpose of the free() function in C?
Which of the following correctly defines a structure in C?
What will be the value of x after executing: int x = 10; x += 5; x *= 2; ?
Which loop construct will execute at least once even if the condition is false?
How is a two-dimensional array typically stored in memory in C?
What is the output of the following code? int x = 5; int y = ++x; printf("%d %d", x, y);
What will be the output of the following code? int *ptr; int arr[3] = {10, 20, 30}; ptr = arr; printf("%d", *(ptr + 1));
What is the primary difference between malloc() and calloc() functions in C?
If arr[5] = {1, 2, 3, 4, 5}, what will be the value of *(arr + 3)?
Consider a structure: struct Point { int x; int y; }; If p is a pointer to this structure and we want to access member x, which notation is INCORRECT?