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 will be the output of the following C code? int main() { int x = 5; int *p = &x; int q = &p; printf("%d", q + 1); return 0; }
Which of the following correctly describes the difference between malloc() and calloc() in C?
What is the output of the following code snippet? int main() { char arr[] = "GATE"; char *p = arr; printf("%d\n", sizeof(arr)); printf("%d", sizeof(p)); return 0; }
Consider a structure with bit fields. What will be the size of the following structure in bytes? struct demo { unsigned int a : 5; unsigned int b : 3; unsigned int c : 4; unsigned int d : 7; };
What is the purpose of the volatile keyword in C?
Which data structure uses the LIFO (Last In First Out) principle and is commonly used for function call management in programming languages?
Which of the following operations has an average time complexity of O(1) in a Hash Table with good hash function and low collision rate?
In a B-tree of order m, what is the maximum number of children a non-leaf node can have?
Which data structure is most suitable for implementing a priority queue where elements with higher priority need to be dequeued first?
What is the output of the following C code? int x = 5; printf("%d", x++);
Which of the following is the correct syntax to declare a pointer in C?
What will be the size of the following array in bytes? char arr[10];
What is the purpose of the 'void' keyword in C?
What is the output of the following C code? int a = 10, b = 20; int c = (a > b) ? a : b; printf("%d", c);
What does the strlen() function return?
What is the output of the following C code? int x = 5; int y = ++x + x++; printf("%d", y);
What is the difference between scanf() and gets() functions?
What is the correct way to allocate memory for a single integer using malloc()?
What is the output of the following C code? int x = 5; int *ptr = &x; printf("%d %d", *ptr, x);
What happens when you use the strcpy() function without bounds checking?