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.41Hard

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

Q.42Hard

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

Q.43Hard

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

Q.44Hard

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

Q.45Hard

Which of the following statements about static variables is TRUE?

Q.46Easy

What is the size of an integer variable in most modern C compilers?

Q.47Easy

Which of the following is NOT a valid C data type?

Q.48Easy

What is the purpose of the & operator in C?

Q.49Easy

Which keyword is used to create a constant variable in C?

Q.50Medium

What will be the memory size of the following struct?
struct Point { int x; char c; int y; }

Q.51Medium

What is the correct way to initialize an array of 5 integers with all elements as 0?

Q.52Medium

Which of the following correctly declares a pointer to a pointer?

Q.53Easy

What is the output of sizeof(char) in C?

Q.54Medium

What is the scope of a variable declared inside a function in C?

Q.55Easy

How many times will the loop execute?
for(int i = 0; i < 5; i++)

Q.56Medium

What is the difference between calloc() and malloc() in C?

Q.57Easy

What will be the value of x after: int x = 5; x += 3;

Q.58Medium

What is the correct syntax to open a file in C?

Q.59Medium

Consider the following code:
int arr[] = {1, 2, 3, 4, 5};
int *ptr = arr;
What is the value of *(ptr + 2)?

Q.60Medium

What is the output of the following code?
for(int i = 1; i <= 3; i++) { if(i == 2) continue; printf("%d ", i); }