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 is the output of the following C code? int x = 5; int y = ++x + x++; printf("%d", y);
What is the difference between scanf() and gets() functions?
What is the correct way to allocate memory for a single integer using malloc()?
What is the output of the following C code? int x = 5; int *ptr = &x; printf("%d %d", *ptr, x);
What happens when you use the strcpy() function without bounds checking?
What is the output of the following C code? int arr[] = {10, 20, 30}; int *ptr = arr; printf("%d", *(ptr + 1));
Which of the following correctly describes the scope of a static variable declared inside a function?
What will be the output of the following C code? int x = 10; int y = 20; int z = x < y ? x++ : y++; printf("%d %d %d", x, y, z);
In C, a pointer variable stores which of the following?
What is the purpose of the malloc() function in C?
Which of the following correctly initializes an array of 5 integers?
What is the default return type of a function in C if not explicitly specified?
What does the break statement do in a loop?
Which of the following is used to access members of a structure using a pointer?
In C, what is the purpose of the #define directive?
What is the correct way to declare a function that takes no parameters and returns an integer?
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?