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 memory size of the following struct? struct Point { int x; char c; int y; }
What is the correct way to initialize an array of 5 integers with all elements as 0?
Which of the following correctly declares a pointer to a pointer?
What is the scope of a variable declared inside a function in C?
What is the difference between calloc() and malloc() in C?
What is the correct syntax to open a file in C?
Consider the following code: int arr[] = {1, 2, 3, 4, 5}; int *ptr = arr; What is the value of *(ptr + 2)?
What is the output of the following code? for(int i = 1; i <= 3; i++) { if(i == 2) continue; printf("%d ", i); }
What is the output of: int x = 10; printf("%d", x++); printf("%d", x);
Which of the following correctly declares a pointer to an integer?
What will be printed if char ch = 'A'; printf("%d", ch); is executed?
Which of the following is used to dynamically allocate memory in C?
What will be the output of: char str[] = "Hello"; printf("%c", str[1]);?
Which function is used to compare two strings in C?
What is the output of the following: int x = 5; int *p = &x; printf("%d", *p);?
What will be the output of: int x = 5; x += 3; printf("%d", x);?
Which loop in C does NOT check the condition before executing the loop body?
What will be the output of: int x = 5; int y = ++x; printf("%d %d", x, y);?
Which function is used to allocate memory dynamically in C?
What is the output of: int a = 10, b = 20; int temp = a; a = b; b = temp; printf("%d %d", a, b);?