iGET

Computer Knowledge - MCQ Practice Questions

Computer Science questions in competitive exams stay close to fundamentals, which is good news if you revise the right five subjects. Coverage includes data structures, algorithms and complexity, operating systems, database management systems, computer networks, and computer organisation. Explanations show the trace or the state table where one helps, since seeing the intermediate steps is what makes the concept stick.

304 questions | 100% Free

Q.181Easy

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

Q.182Medium

What is the output of: int x = 5; int y = ++x; ?

Q.183Medium

What is the purpose of the free() function in C?

Q.184Medium

Which of the following correctly defines a structure in C?

Q.185Medium

What will be the value of x after executing: int x = 10; x += 5; x *= 2; ?

Q.186Medium

Which loop construct will execute at least once even if the condition is false?

Q.187Medium

How is a two-dimensional array typically stored in memory in C?

Q.188Hard

What is the difference between #include <stdio.h> and #include "stdio.h"?

Q.189Hard

Consider the code: int *p; int arr[5]; p = arr; What does p[2] represent?

Q.190Hard

Which of the following will correctly allocate memory for an array of 10 integers?

Q.191Hard

What will be the output of: int x = 5; int y = x++ + ++x; ?

Q.192Easy

Which function is used to read a single character from standard input?

Q.193Easy

In the expression: int arr[3][3]; arr[1][2] = 5; What is being accessed?

Q.194Easy

What is the output of the following C code?
int main() {
int a = 10;
printf("%d", a += 5);
return 0;
}

Q.195Medium

What is the output of the following code?
int x = 5;
int y = ++x;
printf("%d %d", x, y);

Q.196Easy

What is the purpose of the strlen() function in C?

Q.197Medium

What will be the output of the following code?
int *ptr;
int arr[3] = {10, 20, 30};
ptr = arr;
printf("%d", *(ptr + 1));

Q.198Hard

What is the output of this recursive function?
int func(int n) {
if(n <= 1) return 1;
return n * func(n-1);
}
printf("%d", func(4));

Q.199Hard

What is the output of this code involving bitwise operations?
int x = 5; // binary: 0101
int y = 3; // binary: 0011
printf("%d", x ^ y); // XOR operation

Q.200Easy

What will be the value of 'x' after execution of the following code? int x = 10; x += 5; x *= 2;