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? int arr[] = {10, 20, 30}; int *ptr = arr; printf("%d", *(ptr + 1));
Which of the following correctly describes the scope of a static variable declared inside a function?
What will be the output of the following C code? int x = 10; int y = 20; int z = x < y ? x++ : y++; printf("%d %d %d", x, y, z);
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?
Which header file is required to use the printf() function in C?
Which of the following is a valid variable name in C?
What is the return type of the strlen() function?
Which operator has the highest precedence in C?
In C, a pointer variable stores which of the following?
What is the purpose of the malloc() function in C?
Which of the following correctly initializes an array of 5 integers?
What is the default return type of a function in C if not explicitly specified?
What does the break statement do in a loop?
Which of the following is used to access members of a structure using a pointer?
In C, what is the purpose of the #define directive?
What is the correct way to declare a function that takes no parameters and returns an integer?