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

In C, when passing arrays to functions, what is actually passed?

Q.22Hard

What will be the output of: int a = 5; int *p = &a; printf("%d %d", a, *p);?

Q.23Hard

What does the static keyword do when used with a global variable?

Q.24Hard

Consider: int arr[10]; int *p = arr; What is p[5] equivalent to?

Q.25Hard

What is the difference between declaration and definition in C?

Q.26Hard

What happens if you declare a variable but don't initialize it in C?

Q.27Hard

Consider: int *ptr = NULL; *ptr = 5; What will happen?

Q.28Hard

What does the 'volatile' keyword indicate in C?

Q.29Hard

Consider: int *ptr; int arr[] = {1,2,3}; ptr = arr; What is ptr[1]?

Q.30Hard

What is the difference between getchar() and scanf("%c", &ch); in C?

Q.31Hard

Which of the following correctly describes the relationship between arrays and pointers in C?

Q.32Hard

What is the difference between a function declaration and a function definition in C?

Q.33Hard

Which of the following is the correct way to declare a pointer to a function that returns an int and takes two int parameters?

Q.34Hard

Consider: int *p, q; What is the type of q?

Q.35Hard

What is printed by: char s[] = "hello"; printf("%zu", sizeof(s));?

Q.36Hard

What will be the result of: 5 % 2 * ?

Q.37Hard

In a struct, how is memory allocated for union members?

Q.38Hard

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

Q.39Hard

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

Q.40Hard

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