Practice C Programming Questions and Answers
- Which of the following is correct for a single-line comment in C++?
- In Python, what does len() function do?
- Which of the following is correct about C++ constructors?
- In Java, which data type is used to store true or false values?
- Which C operator is used to access a value at a memory address stored in a pointer?
- In Python, which of the following is used to create an anonymous function?
- Which of the following is true about C++ destructors?
- In C, which function is used to dynamically allocate memory?
- Which of the following statements is correct for Python lists?
- Which of the following algorithms is used for finding Minimum Spanning Tree?
- Which of the following is true about MergeSort?
- ch data structure is used in Depth-First Search (DFS)?
- Which algorithm is used to find the shortest path from a single source in graphs with negative weights?
- Which of the following sorting algorithms is stable?
- In Java, which method is used to start a thread?
- Which of the following is used to declare a list in Python?
- In C++, which feature allows hiding the internal details of a class?
- In C, what will be the output of the following code? int a = 5; printf("%d", a++);
- Which Java keyword is used to inherit a class?
- Which Python keyword is used to handle exceptions?
- In C++, which operator is used to access a member function through a pointer to an object?
- In C, which function is used to release dynamically allocated memory?
- Which of the following is true about Java interfaces?
- In Python, which method is used to convert a string to lowercase?
- Which of the following is a valid C++ constructor?
- In C, which keyword is used to define a constant value?
- In Java, which method is called when an object is garbage collected?
- Which Python statement is used to create an empty set?
- In C++, which access specifier allows members to be accessible only within the class?
- Consider a table Orders with columns OrderID, CustomerID, OrderDate, and TotalAmount. Which SQL query would correctly find the total number of orders and t...
- What will be the output of the following C code snippet? int a = 10; int *p = &a; *p = 20; printf("%d", a);
- Which storage class specifier in C allows a local variable to retain its value between successive function calls, while keeping its scope limited to the fu...
- What is the output of the following C code? #include int main() { Β Β int i; Β Β for (i = 0; i < 3; i++) { Β Β Β Β printf("%d ", i); Β Β } Β Β ...
- What is the output of the following C++ code? #includeΒ Β Β using namespace std; int main() { Β Β int x = 5; Β Β int &ref = x; Β Β ref = 10; Β Β ...
- Which C++ inheritance access specifier, when used to inherit a base class, causes all public and protected members of the base class to become private memb...
- What is the output of the following C code? int arr[5] = {10, 20, 30, 40, 50}; int *p = arr; printf("%d", *(p+2) + *(arr+3) - *(p+1));
- In C++, a base class pointer holds the address of a derived class object. The base class declares a non-virtual member function that the derived class rede...
- What is the output of the following C code? int x = 5, y = 2; printf("%d", x++ / y + x % y);
- What is a key difference between the malloc() and calloc() functions in C?
- Consider the following C structure on a typical 32-bit system, where int is 4 bytes, char is 1 byte, and the compiler applies default structure padding for...
More Topics
- Algorithms Questions
- Analog and Digital Communication Questions
- Artificial Intelligence & Machine Language Questions
- Basics of Computers Questions
- Big Data Analytics Questions
- C++ Questions
- Compiler Design Questions
- Computer Architecture and Design Questions
- Cyber Security Questions
- Data Analytics Languages Questions
- Data Structure Questions
- Data Warehousing Questions
- Digital Logic Questions
- IOT and mobile Computing Questions
- IT DBMS Questions
- IT Networking Questions
- IT Operating System Questions
- Java Language Questions
- Machine Learning Questions
- Memory Management Questions
- Microsoft Office Questions
- Miscellaneous Questions Questions
- Network Layer and IP Protocol Questions
- Numerical and Statistical Computing Questions
- Object Oriented Programming Questions
- OOPS Concepts Questions
- Previous Year Questions Questions
- Programming Concept Questions
- Python Questions
- Shell Scripting Questions
- Software Engineering and Web Technology Questions
- SQL Questions
- String Manipulation Questions
- TCP IP and OSI Questions