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
What is the output of the following C code? #include <stdio.h> int main() { int a = 5; printf("%d %d %d", a++, ++a, a); return 0; }
What is the correct way to declare a constant pointer to a constant integer?
Consider the following C code. What will be printed? int arr[3][3] = {{1,2,3}, {4,5,6}, {7,8,9}}; int *ptr = (int *)arr; printf("%d", *(ptr + 5));
What is the output of the following C code? #define MAX 5 int main() { int arr[MAX]; printf("%d", sizeof(arr)/sizeof(arr[0])); return 0; }
What is the difference between struct and union in C?
What will be the output of: int x = 5; printf("%d", ++x);?
Consider a pointer ptr pointing to an integer array. What does ptr[2] represent?
What is the time complexity of searching for an element in an unsorted array using linear search?
What will be the result of executing: int a = 5, b = 10; int *ptr = &a; ptr = &b; printf("%d", *ptr);?
Which of the following statements about static variables is TRUE?
What happens when you try to access an array element beyond its size in C?
Which of the following is the correct way to pass a string to a function in C?
Which of the following is an invalid identifier in C?
What will be the output of: int x = 5; printf("%d %d", x++, ++x);?
What is the difference between structure and union in C?
Which of the following function declarations is correct for a function that takes no parameters and returns no value?
In C, what is the purpose of the typedef keyword?
In C, when passing arrays to functions, what is actually passed?
What will be the output of: int a = 5; int *p = &a; printf("%d %d", a, *p);?
What does the static keyword do when used with a global variable?