iGET

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

Q.1Hard

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; }

Q.2Hard

What is the correct way to declare a constant pointer to a constant integer?

Q.3Hard

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));

Q.4Hard

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; }

Q.5Hard

What is the difference between struct and union in C?

Q.6Hard

What will be the output of: int x = 5; printf("%d", ++x);?

Q.7Hard

Consider a pointer ptr pointing to an integer array. What does ptr[2] represent?

Q.8Hard

What is the time complexity of searching for an element in an unsorted array using linear search?

Q.9Hard

What will be the result of executing: int a = 5, b = 10; int *ptr = &a; ptr = &b; printf("%d", *ptr);?

Q.10Hard

Which of the following statements about static variables is TRUE?

Q.11Hard

What happens when you try to access an array element beyond its size in C?

Q.12Hard

Which of the following is the correct way to pass a string to a function in C?

Q.13Hard

Which of the following is an invalid identifier in C?

Q.14Hard

What will be the output of: int x = 5; printf("%d %d", x++, ++x);?

Q.15Hard

What is the difference between structure and union in C?

Q.16Hard

Which of the following function declarations is correct for a function that takes no parameters and returns no value?

Q.17Hard

In C, what is the purpose of the typedef keyword?

Q.18Hard

In C, when passing arrays to functions, what is actually passed?

Q.19Hard

What will be the output of: int a = 5; int *p = &a; printf("%d %d", a, *p);?

Q.20Hard

What does the static keyword do when used with a global variable?