iGET

Computer Knowledge - MCQ Practice Questions

Practice free Computer Knowledge multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

304 questions | 100% Free

Q.21Hard

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

Q.22Hard

What is the difference between declaration and definition in C?

Q.23Hard

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

Q.24Hard

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

Q.25Hard

What does the 'volatile' keyword indicate in C?

Q.26Hard

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

Q.27Hard

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

Q.28Hard

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

Q.29Hard

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

Q.30Hard

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

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

Q.32Hard

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

Q.33Hard

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

Q.34Hard

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

Q.35Hard

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

Q.36Hard

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

Q.37Hard

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

Q.38Hard

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

Q.39Hard

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

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