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
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);?
Which of the following is an invalid identifier in C?
What will be the output of: int x = 5; printf("%d %d", x++, ++x);?
What is the difference between structure and union in C?
Which of the following function declarations is correct for a function that takes no parameters and returns no value?
In C, what is the purpose of the typedef keyword?
In C programming, which of the following is NOT a valid data type?
What will be the output of: int a = 10; int b = 20; int c = a + b; printf("%d", c);?
Which of the following is used to declare a constant in C?
What is the purpose of the return statement in a C function?
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);?
In C, what does the scanf() function do?
What will be the output of: for(int i = 0; i < 3; i++) { printf("%d ", i); }?