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: char *s = "Hello"; printf("%d", strlen(s));
What will be the output of: int x = 5; printf("%d", x << 1);
Consider the code: int arr[10]; int *p = arr; What is p[5]?
What is the purpose of the void pointer in C?
What will be the output of: #define MAX 10; int x = MAX; printf("%d", x);
Which function is used to read a string from standard input?
What will be the output of: int x = 10; int y = x++ + ++x; printf("%d", y);
What is the output of: int arr[] = {1,2,3,4,5}; printf("%d", sizeof(arr)/sizeof(arr[0]));
Which of the following correctly initializes a 2D array?
What will be the output of: printf("%d", );
What does the getchar() function do?
What will be the output of: int a = 5, b = 5; if(a == b) printf("Equal"); else printf("Not Equal");
What will be the output of: char c = 'A'; printf("%d", c);
Consider a complex expression: int x = 2 + 3 * 4 - ; What is x?
Which header file is essential for using the printf() function in C?
What is the output of: int arr[5]; printf("%d", sizeof(arr));
Which function is used to allocate memory dynamically at runtime?
What is the purpose of the break statement in a switch case?
What will be the output of: int x = 5, y = 10; if (x < y) printf("yes"); else printf("no");
Which of the following is NOT a valid way to pass arguments to a function in C?