Programming Languages (C, C++, Java, Python, etc.) 🚀
Programming Languages (C, C++, Java, Python, etc.) – 50 One-Liner Q&A
C Language (Basics)
Q.1. Who is the father of C language?
Ans. Dennis Ritchie.
Q.2. When was C developed?
Ans. 1972 at Bell Labs.
Q.3. C is a ______ level language.
Ans. Middle-level language.
Q.4. What is the default return type of main() in C?
Ans. int.
Q.5. Which symbol is used to denote a preprocessor directive in C?
Ans. # (hash symbol).
Q.6. Which keyword is used to declare constants in C?
Ans. const.
Q.7. Which function is used for output in C?
Ans. printf().
Q.8. Which function is used for input in C?
Ans. scanf().
Q.9. Which header file is used for standard I/O in C?
Ans. stdio.h.
Q.10. Which keyword is used to define a structure in C?
Ans. struct.
C++ Language
Q.11. Who is the father of C++?
Ans. Bjarne Stroustrup.
Q.12. When was C++ developed?
Ans. 1979.
Q.13. C++ is also called ______.
Ans. Object-Oriented C.
Q.14. What are the main features of OOP in C++?
Ans. Encapsulation, Inheritance, Polymorphism, Abstraction.
Q.15. Which operator is overloaded in C++ by default?
Ans. Assignment (=).
Q.16. What is a constructor in C++?
Ans. A special function that initializes objects.
Q.17. What is a destructor in C++?
Ans. A special function that destroys objects when they go out of scope.
Q.18. Which keyword is used for inheritance in C++?
Ans. : (colon symbol after class).
Q.19. What is function overloading?
Ans. Same function name with different parameters.
Q.20. What is operator overloading?
Ans. Redefining operators for user-defined data types.
Java
Q.21. Who is the father of Java?
Ans. James Gosling.
Q.22. When was Java developed?
Ans. 1995 by Sun Microsystems.
Q.23. Java is also called ______.
Ans. WORA (Write Once, Run Anywhere).
Q.24. Which company currently owns Java?
Ans. Oracle Corporation.
Q.25. What is JVM in Java?
Ans. Java Virtual Machine – executes Java bytecode.
Q.26. What is JDK?
Ans. Java Development Kit.
Q.27. What is JRE?
Ans. Java Runtime Environment.
Q.28. What is bytecode in Java?
Ans. Intermediate code executed by JVM.
Q.29. Which keyword is used for inheritance in Java?
Ans. extends.
Q.30. Which keyword is used for interfaces in Java?
Ans. implements.
Python
Q.31. Who is the father of Python?
Ans. Guido van Rossum.
Q.32. When was Python released?
Ans. 1991.
Q.33. Python is a ______ language.
Ans. High-level, interpreted language.
Q.34. What is PEP 8 in Python?
Ans. Python Enhancement Proposal for style guide.
Q.35. Which data type is mutable in Python?
Ans. List, Dictionary, Set.
Q.36. Which data type is immutable in Python?
Ans. String, Tuple, Frozenset.
Q.37. What is indentation used for in Python?
Ans. To define code blocks.
Q.38. Which keyword is used for function definition in Python?
Ans. def.
Q.39. Which Python library is used for data analysis?
Ans. Pandas.
Q.40. Which Python library is used for machine learning?
Ans. Scikit-learn.
General Programming Concepts
Q.41. What is a compiler?
Ans. A program that converts source code into machine code.
Q.42. What is an interpreter?
Ans. A program that executes code line by line.
Q.43. Which languages are compiled?
Ans. C, C++.
Q.44. Which languages are interpreted?
Ans. Python, JavaScript.
Q.45. What is recursion?
Ans. A function calling itself.
Q.46. What is polymorphism?
Ans. Ability of a function/object to take many forms.
Q.47. What is encapsulation?
Ans. Wrapping data and methods into a single unit (class).
Q.48. What is abstraction?
Ans. Hiding implementation details and showing only essential features.
Q.49. What is garbage collection?
Ans. Automatic memory management (available in Java, Python).
Q.50. Which language is called the “mother of all programming languages”?
Ans. C language.
0 Comments