MCQs on Introduction to C Programming | C Programming

Explore the fundamentals of C programming with this comprehensive collection of multiple-choice questions (MCQs). Perfect for beginners, these questions cover key concepts like variables, functions, operators, and control structures. Test your knowledge and enhance your understanding of C programming.

Hello Guys, the best way to go through this MCQs collection is below:

  1. Take a sheet
  2. note down the answer options
  3. Finally compare with the answers at last and score yourself.

Chapter 1: Introduction to C Programming

1. History of C

  1. Who developed the C programming language?
    • a) Bjarne Stroustrup
    • b) Dennis Ritchie
    • c) James Gosling
    • d) Brian Kernighan
  2. Which programming language is the predecessor of C?
    • a) Assembly
    • b) ALGOL
    • c) B
    • d) Java
  3. When was the C programming language created?
    • a) 1980
    • b) 1972
    • c) 1990
    • d) 1969
  4. Which company developed the C language?
    • a) IBM
    • b) AT&T Bell Labs
    • c) Microsoft
    • d) Oracle
  5. What was the primary purpose of the creation of C?
    • a) To develop operating systems
    • b) To create web applications
    • c) To write software for mobile devices
    • d) To create games
  6. C language was originally developed for which operating system?
    • a) Windows
    • b) UNIX
    • c) DOS
    • d) Linux
  7. Which language did C replace in the early 1970s?
    • a) COBOL
    • b) Fortran
    • c) B
    • d) Pascal
  8. What is the origin of the name “C” for the C programming language?
    • a) The first letter of the developer’s name
    • b) It comes from the predecessor language, “B”
    • c) It stands for “Complex”
    • d) None of the above
  9. Which year was C standardized by ANSI (American National Standards Institute)?
    • a) 1983
    • b) 1991
    • c) 1995
    • d) 2000
  10. What was the impact of C on modern programming languages?
    • a) It introduced object-oriented programming concepts
    • b) It led to the development of many programming languages
    • c) It focused only on mathematical calculations
    • d) None of the above

2. Features and Applications of C

  1. Which of the following is a feature of the C language?
    • a) High-level language
    • b) Procedural language
    • c) Object-oriented
    • d) Interpreted language
  2. Which of the following applications is C commonly used for?
    • a) Web development
    • b) System programming
    • c) Desktop applications
    • d) Mobile applications
  3. Which of the following is NOT a feature of C?
    • a) Portability
    • b) Flexibility
    • c) High-level language
    • d) Object-oriented programming
  4. What makes C a portable language?
    • a) It can run on different platforms without modification.
    • b) It is simple to learn.
    • c) It provides extensive libraries.
    • d) It is used in desktop applications.
  5. C is a _____ programming language.
    • a) Object-oriented
    • b) Functional
    • c) Procedural
    • d) Logical
  6. What makes C suitable for system-level programming?
    • a) It is a high-level language.
    • b) It allows direct manipulation of hardware.
    • c) It supports object-oriented programming.
    • d) It is easier to learn than assembly language.
  7. Which of the following is an application of C?
    • a) Operating system development
    • b) Web page design
    • c) Game development (JavaScript)
    • d) None of the above
  8. Which software development process benefits most from C programming?
    • a) Web design
    • b) Desktop application development
    • c) Embedded systems development
    • d) Video editing
  9. Which of these is a key feature of C?
    • a) Dynamic typing
    • b) Direct memory manipulation
    • c) Multi-paradigm programming
    • d) Object-oriented
  10. Which of the following is a disadvantage of C?
    • a) It is not as fast as assembly language.
    • b) It lacks memory control.
    • c) It requires a specific hardware environment.
    • d) It doesn’t support high-level operations.

3. Structure of a C Program

  1. Which of the following is the first line of a basic C program?
    • a) #include <stdio.h>
    • b) int main()
    • c) printf(“Hello World”);
    • d) #define
  2. Which keyword is used to declare the main function in C?
    • a) function
    • b) main
    • c) start
    • d) program
  3. What is the purpose of the #include directive in C?
    • a) To include a header file
    • b) To define a function
    • c) To declare a variable
    • d) To print output
  4. Where does the program execution start in a C program?
    • a) From the main() function
    • b) From printf()
    • c) From #include
    • d) From return 0
  5. Which of the following sections is a part of the structure of a C program?
    • a) Function definition
    • b) Header files
    • c) Variable declarations
    • d) All of the above
  6. What is the purpose of a header file in C?
    • a) To define variables
    • b) To declare functions
    • c) To include libraries
    • d) All of the above
  7. Which of the following is an essential part of a C program?
    • a) Data types
    • b) Functions
    • c) The main function
    • d) Comments
  8. What is the role of the return statement in C?
    • a) To print output
    • b) To return a value from a function
    • c) To include libraries
    • d) To declare variables
  9. What is a valid C program structure?
    • a) Header file → Function declaration → Main function
    • b) Function declaration → Main function → Header file
    • c) Header file → Main function → Function declaration
    • d) None of the above
  10. Which of these can be a C program’s entry point?
    • a) int main()
    • b) void start()
    • c) void main()
    • d) start()

4. Compilation and Execution Process

  1. What is the first step in compiling a C program?
    • a) Linking
    • b) Preprocessing
    • c) Assembly
    • d) Execution
  2. In which phase does the C compiler handle preprocessor directives like #include and #define?
    • a) Preprocessing
    • b) Compilation
    • c) Linking
    • d) Execution
  3. What is the role of the linker in the C compilation process?
    • a) Translates high-level code to machine code
    • b) Combines object files into a single executable
    • c) Handles syntax errors
    • d) None of the above
  4. What is generated after the compilation phase in the C compilation process?
    • a) Object code
    • b) Source code
    • c) Executable file
    • d) None of the above
  5. Which tool is responsible for turning C source code into machine code?
    • a) Compiler
    • b) Editor
    • c) Assembler
    • d) Linker
  6. In which phase does the C program become executable?
    • a) Linking
    • b) Compilation
    • c) Preprocessing
    • d) Execution
  7. Which of the following is an error that can occur during the compilation process?
    • a) Syntax error
    • b) Runtime error
    • c) Logical error
    • d) All of the above
  8. What is the purpose of an object file in C?
    • a) It is an intermediate code before linking.
    • b) It contains the final executable.
    • c) It stores preprocessor directives.
    • d) It defines the structure of the program.
  9. What command is typically used to compile a C program in a Linux environment?
    • a) gcc
    • b) make
    • c) clang
    • d) link
  10. What file is produced after a C program is compiled and linked?
    • a) .exe
    • b) .obj
    • c) .out
    • d) All of the above

5. Basic Syntax and Structure (main function, header files, etc.)

  1. What does the #include <stdio.h> directive do?
    • a) Includes the math library
    • b) Includes the standard input/output library
    • c) Defines a function
    • d) Creates a variable
  2. Which function is always executed first in a C program?
    • a) printf
    • b) scanf
    • c) main
    • d) start
  3. Which of the following is a valid C function definition?
    • a) main() { }
    • b) void main() { }
    • c) void main { }
    • d) function main() { }
  4. Which symbol is used to denote the end of a statement in C?
    • a) ;
    • b) .
    • c) :
    • d) ,
  5. How is a comment written in C?
    • a) // This is a comment
    • b) # This is a comment
    • c) /* This is a comment */
    • d) Both a and c
  6. What does the return 0; statement indicate in the main() function?
    • a) Successful program execution
    • b) Syntax error
    • c) Logical error
    • d) The end of the program
  7. Which of these is required in every C program?
    • a) main function
    • b) printf function
    • c) header files
    • d) return statement
  8. What does the void keyword in void main() indicate?
    • a) The function has no parameters
    • b) The function has no return value
    • c) The function has parameters
    • d) The function is an operator
  9. What is the standard output function in C?
    • a) print()
    • b) output()
    • c) printf()
    • d) display()
  10. What is the correct syntax to declare a variable in C?
    • a) int x;
    • b) x int;
    • c) declare int x;
    • d) int = x;

Answers

Answers:

No.Answer
1b) Dennis Ritchie
2c) B
3b) 1972
4b) AT&T Bell Labs
5a) To develop operating systems
6b) UNIX
7c) B
8b) It comes from the predecessor language, “B”
9a) 1983
10b) It led to the development of many programming languages
11b) Procedural language
12b) System programming
13d) Object-oriented programming
14a) It can run on different platforms without modification.
15c) Procedural
16b) It allows direct manipulation of hardware.
17a) Operating system development
18c) Embedded systems development
19b) Direct memory manipulation
20c) It requires a specific hardware environment.
21a) #include <stdio.h>
22b) main
23a) To include a header file
24a) From the main() function
25d) All of the above
26c) To include libraries
27c) The main function
28b) To return a value from a function
29a) Header file → Function declaration → Main function
30a) int main()
31b) Preprocessing
32a) Preprocessing
33b) Combines object files into a single executable
34a) Object code
35a) Compiler
36a) Linking
37a) Syntax error
38a) It is an intermediate code before linking.
39a) gcc
40a) .exe
41b) Includes the standard input/output library
42c) main
43a) main() { }
44a) ;
45d) Both a and c
46a) Successful program execution
47a) main function
48b) The function has no return value
49c) printf()
50a) int x;

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top