C Programming Quiz
Welcome to the C programming quiz. Test your knowledge and skills on various topics of C programming by answering multiple choice questions. there are total 15 questions with answers. Each question has four options and only one of them is correct. You can also view the correct answer and explanation for each question at the end of the each question. Good luck and have fun!
Question 1: Who is the father of C language?
a) Steve Jobs
b) James Gosling
c) Dennis Ritchie
d) Rasmus Lerdorf
Answer: c) Dennis Ritchie
Explanation: Dennis Ritchie was an American computer scientist who created the C programming language in 1972 at Bell Labs. He also co-developed the Unix operating system with Ken Thompson.
Question 2: Which of the following languages influenced the development of C language?
a) ALGOL
b) BCPL
c) B
d) All of the above
Answer: d) All of the above
Explanation: C language was influenced by several languages, such as ALGOL (a family of high-level languages), BCPL (a low-level language created by Martin Richards), and B (a simplified version of BCPL created by Ken Thompson).
Question 3: What was the original purpose of creating C language?
a) To write system software
b) To write application software
c) To write web applications
d) To write games
Answer: a) To write system software
Explanation: C language was originally created to write system software, such as operating systems, compilers, editors, etc. It was designed to be efficient, portable and expressive.
Question 4: Which of the following books is considered as the bible of C language?
a) The C Programming Language by Brian Kernighan and Dennis Ritchie
b) The Art of Computer Programming by Donald Knuth
c) The Pragmatic Programmer by Andy Hunt and Dave Thomas
d) Code Complete by Steve McConnell
Answer: a) The C Programming Language by Brian Kernighan and Dennis Ritchie
Explanation: The C Programming Language by Brian Kernighan and Dennis Ritchie is a classic book that introduces the basic concepts and features of C language. It is also known as K&R, after the initials of the authors.
Question 5: Which of the following standards defines the core features and syntax of C language?
a) ANSI C
b) ISO C
c) POSIX C
d) Both a and b
Answer: d) Both a and b
Explanation: ANSI C and ISO C are two standards that define the core features and syntax of C language. ANSI C was developed by the American National Standards Institute in 1989, while ISO C was developed by the International Organization for Standardization in 1990. They are largely compatible with each other.
Question 6: Which of the following keywords was added in the ANSI C standard?
a) const
b) volatile
c) void
d) All of the above
Answer: d) All of the above
Explanation: const, volatile and void are three keywords that were added in the ANSI C standard. const specifies that a variable or a pointer is constant and cannot be modified. volatile specifies that a variable may be changed by external factors and should not be optimized by the compiler. void specifies that a function does not return any value or that a pointer does not point to any type.
Question 7: Which of the following features was added in the ISO C99 standard?
a) Inline functions
b) Variable-length arrays
c) Single-line comments
d) All of the above
Answer: d) All of the above
Explanation: Inline functions, variable-length arrays and single-line comments are some of the features that were added in the ISO C99 standard. Inline functions are functions that are expanded at the point of call, rather than being invoked. Variable-length arrays are arrays whose size is determined at run time, rather than at compile time. Single-line comments are comments that start with // and end at the end of the line.
Question 8: Which of the following features was added in the ISO C11 standard?
a) Generic programming
b) Static assertions
c) Anonymous structures and unions
d) All of the above
Answer: d) All of the above
Explanation: Generic programming, static assertions and anonymous structures and unions are some of the features that were added in the ISO C11 standard. Generic programming allows writing functions that can operate
Question 9: Which of the following languages is a direct descendant of C language?
a) C++
b) Java
c) Python
d) All of the above
Answer: a) C++
Explanation: C++ is a direct descendant of C language, as it was created by extending C language with object-oriented features, such as classes, inheritance, polymorphism, etc. C++ is also compatible with most of the C code, except for some features that are deprecated or modified.
Question 10: Which of the following languages is an indirect descendant of C language?
a) Java
b) Python
c) Ruby
d) All of the above
Answer: d) All of the above
Explanation: Java, Python and Ruby are indirect descendants of C language, as they were influenced by C language in some aspects, such as syntax, data types, operators, etc. However, they also have many differences from C language, such as being interpreted rather than compiled, having dynamic typing rather than static typing, having garbage collection rather than manual memory management, etc.
Question 11: Which of the following languages is not related to C language?
a) Lisp
b) Fortran
c) Cobol
d) All of the above
Answer: d) All of the above
Explanation: Lisp, Fortran and Cobol are not related to C language, as they belong to different paradigms and have different origins and goals. Lisp is a functional language that uses lists as its main data structure and supports recursion and metaprogramming. Fortran is an imperative language that was designed for scientific and numerical computing. Cobol is a procedural language that was designed for business applications.
Question 12: Which of the following operating systems is written in C language?
a) Windows
b) Linux
c) MacOS
d) All of the above
Answer: d) All of the above
Explanation: Windows, Linux and MacOS are all written in C language, at least partially. C language is widely used for writing operating systems, as it provides low-level access to hardware and memory, as well as high-level abstraction and portability.
Question 13: Which of the following applications is written in C language?
a) Photoshop
b) Firefox
c) MySQL
d) All of the above
Answer: d) All of the above
Explanation: Photoshop, Firefox and MySQL are all written in C language, at least partially. C language is widely used for writing applications that require high performance, reliability and efficiency.
Question 14: Which of the following statements is true about C language?
a) C is a high-level language
b) C is a low-level language
c) C is a mid-level language
d) None of the above
Answer: c) C is a mid-level language
Explanation: C is a mid-level language, as it combines features of both high-level and low-level languages. It provides high-level abstraction and portability, such as data types, functions, operators, etc. It also provides low-level access and control, such as pointers, memory management, bitwise operations, etc.
Question 15: Which of the following statements is false about C language?
a) C supports object-oriented programming
b) C supports generic programming
c) C supports procedural programming
d) None of the above
Answer: a) C supports object-oriented programming
Explanation: C does not support object-oriented programming, as it does not have features such as classes, objects, inheritance etc.
COMMENT YOUR SCORE!
We love your feedback and invite you to comment on our articles, exercises, examples, quizzes and others. Your feedback helps us make our content awesome and serve you better. Please leave a comment and tell us what you think. How did our content help you learn something new? Thank you for being a part of our community!