1. What is C?
C is a procedural programming language used for system and application programming.
2. What is C++?
C++ is an extension of C that supports object-oriented programming.
3. Who developed C language?
C was developed by Dennis Ritchie.
4. Who developed C++ language?
C++ was developed by Bjarne Stroustrup.
5. What is a compiler?
A compiler converts high-level code into machine code.
6. What is an interpreter?
An interpreter executes code line by line.
7. What is the difference between C and C++?
C is procedural, while C++ supports both procedural and object-oriented programming.
8. What is a variable?
A variable is a named memory location used to store data.
9. What is a data type?
A data type specifies the type of data a variable can hold.
10. Name basic data types in C.
int, float, char, double.
11. What is a keyword?
A keyword is a reserved word with a special meaning in the language.
12. What is a constant?
A constant is a value that cannot be changed during program execution.
13. What is a pointer?
A pointer stores the address of another variable.
14. What is NULL pointer?
A pointer that does not point to any valid memory location.
15. What is an array?
An array stores multiple values of the same type in continuous memory.
16. Difference between array and pointer?
Array stores data, pointer stores address.
17. What is a function?
A function is a block of code that performs a specific task.
18. What is function prototype?
It declares the function before it is used.
19. What is recursion?
A function calling itself is called recursion.
20. What is infinite loop?
A loop that never ends unless externally stopped.
21. What is loop?
A loop repeats a block of code until a condition fails.
22. Types of loops in C/C++?
for, while, do-while.
23. What is break statement?
It terminates the loop or switch immediately.
24. What is continue statement?
It skips the current iteration and continues with the next one.
25. What is structure?
A structure groups variables of different data types.
26. What is union?
Union shares memory among all its members.
27. Difference between structure and union?
Structure allocates separate memory, union shares memory.
28. What is typedef?
typedef creates a new name for an existing data type.
29. What is enum?
enum defines a set of named integer constants.
30. What is file handling?
It is used to store and retrieve data from files.
31. What is fopen()?
It opens a file in C.
32. Difference between printf and cout?
printf is used in C, cout is used in C++.
33. What is scanf?
scanf is used to take input in C.
34. What is cin?
cin is used to take input in C++.
35. What is class in C++?
A class is a blueprint for creating objects.
36. What is object?
An object is an instance of a class.
37. What is encapsulation?
Binding data and functions together in a class.
38. What is abstraction?
Showing only essential details and hiding implementation.
39. What is inheritance?
One class acquiring properties of another class.
40. What is polymorphism?
Same function name performing different tasks.
41. What is constructor?
A special function that initializes objects.
42. What is destructor?
A function that releases resources of an object.
43. What is virtual function?
A function that supports runtime polymorphism.
44. What is friend function?
A function that can access private members of a class.
45. Difference between malloc and new?
malloc is used in C, new is used in C++.
46. What is namespace?
Namespace avoids name conflicts in C++.
47. What is header file?
A file containing function declarations.
48. Difference between .c and .cpp?
.c is for C programs, .cpp is for C++ programs.
49. What is dangling pointer?
A pointer pointing to deallocated memory.
50. What is dynamic memory allocation?
Allocating memory during runtime using malloc or new.
Comments
Post a Comment