What is an operating system?
C seems to have been originally developed as a simple programming language that helped in building operating systems that were later used in minicomputers like the DEC PDP 7, which seemed to contain minimal memory capacity when compared to mainframe machines at the time. The development of c programming began in the 1970s with the help of a language called CPL. The c language was similar and had reference to CPL, which is commonly known as a combined programming language; the CPL was a language that was developed by Ken Thompson. The development of CPL was around 1969–70. Ritchie, a colleague of Thompson, further developed the CPL language, then redesigned as well as restored common important CPU features and developed a new functioning language called C, and afterward recreated the UNIX OS with the new language.
Multiple Choice Questions (MCQs)
Q1. Which of the following is an important requirement of c programming?
- Function
- Input variables
- Output variables
- All of the above
Answer: a) function. Every c programming needs at least one function as they facilitate the whole programming process. The functions seem to act as a subprogram within the whole c programming procedure. Functions can be crucial as they contain various variables that need to be reused multiple times.
Q2. Which of the following is true in the case of c programming?
- The function is a variable.
- Parenthesis isn’t needed at all in c programming.
- There is no need for closing parenthesis in c programming
- Float is a variable.
Answer: d)Float is a variable. The float seems to be a type of variable associated with c programming and multiple other programming languages. Variables can be of different types, such as int, char, double, float, etc.
Q3. When was C programming developed?
- The 1950s
- The 1960s
- The 1980s
- The 1970s
Answer: d) the 1970s. The C programming language was developed by a scientist called Dennis M. Ritchie. He developed the c programming language around the 1970s after taking references from a computer language known as a combined programming language (CPL).
Q4. What was C programming adapted from?
- C++
- Combined programming language
- python
- All of the above
Answer: b) combined programming language(CPL). C programming was developed with the help of a language called combined programming language, which was developed by a scientist named Ken Thompson. He was a colleague of Ritchie, who was the developer of the C programming language.
Q5. Which of the following is not a variable type in c programming?
- Float
- Int
- While loop
- All of the above
Answer. c) While loop. The float and int are commonly used variable types, and the while loop seems to be a specific type of programming language that has no properties of a variable and helps in scenarios where a program needs to run in loops.
Q6. What is the use of print f in c programming?
- Helps in the printing of a string on the output screen
- Processes the variables in a program
- Is a variable type
- All of the above
Answer. b) Helps in the printing of strings on the output screen. The print f command seems to be used by users of c programming for printing outputs of string elements on the output screen. This is one of the most used commands as it helps in recognizing all the programming is done and its output.
Q7. What are strings in C programming?
- Individual variables
- Group of function
- Group of character type variables in array form
- All of the above
Answer. c) Group of character type variables in array form. Strings are a group of variables that can be of character type as well as any other variable type. The strings can contain constant values as well as variables that can change over time. Strings have the property of containing a large number of arrays.
Q8. What does a do-while loop do?
- Repeats the process infinitely
- Processes the code at least once and then repeats
- Repeats only once
- All of the above
Answer. b) Processes the code at least once and then repeats. The do-while loop, unlike the while loop, executes the code within the loop at least once at the beginning and then enters the loop once again only if the boolean condition says so.
Q9. What is a while loop?
- Repeats the loop if the condition applies true
- Processes the code at least once and then repeats
- Repeats only once
- All of the above
Answer. a) repeats the code infinitely. The while loop, unlike the do-while loop, can only execute the code only if the boolean condition is satisfied, then can run infinitely if needed.
Q10. What of the following is true?
- Variables are functions
- Variable is a type of output command
- Variables are used to store values
- All of the above
Answer. c) Variables are used to store values. Variables are a type of memory that seems to store all the input values or unknown values generated during the coding procedure. It is used as a storing unit.
Q11. What are float variables?
- Integer value
- unknown value
- Decimal value
- All of the above
Answer. c) decimal value. The variables are of different types, and one of them is a float which has the properties of storing fraction values that are in decimal form. This helps in recording nonwhole numbers without any issue.
Q12. What is a function?
- Looping code
- Code that operates when called
- Unknown variable
- All of the above
Answer. b) Code that operates when called. The function seems to be a block of code that can only run when the function name is called upon by the code. It is usually used to run large chunks of code with one command called function calling.
Q13. How many variables can the following string contain bat[45]?
- 20
- 40
- 44
- 45
Answer. d) 45. As shown in the string mentioned as bat[45], the value 45 represents the number of distinct variables that the whole string can contain and execute in one instance.
Q14. What is function overloading?
- Process of multiple functions
- Multiple functions with the same name
- Looping functions
- All of the above
Answer. b) Multiple functions with the same name. The term function overloading is used when two or more functions have the same names. C programming has a property that allows two functions with the same name to exist at one time, but their variables need to be different.
Q15. Which header file uses gets()?
- Studio. h
- Stdlib.h
- Conio.h
- All of the above
Answer. c) conio.h. The getch() command is used to show the output screen for a while and is used to read single characters on a compiler screen, later resulting in exiting the console or terminal screen. The getch() falls under the conio.h header file and can only run on old compiler softwares.
Q16. Which of the following is the wrong way of writing c language?
- Int bat;
- Float cat_a;
- Int @rat
- All of the above
Answer. c) Int @rat. The variables can only be represented in the form of normal characters with an only underscore as an exception. No other type of special characters is allowed informing data types. So, in this case, @ cannot be used to represent int data type.
Q17. What are const data types used for?
- Unknown values
- Static or constant values
- Dynamic variable values
- All of the above
Answer. b) Static or constant values. The const data types are used for storing constant values that don’t have any requirements of change in their values in the near future. The const data type serves as a lock system for these values.
Q18. What are the primary iterations in C programming?
- While loop
- Do while loop
- For loop
- All of the above
Answer. d) all of the above. Iteration seems to be a process in c programming where a specific block of code runs on a constant of the controlled loop, and the whole process involves boolean conditions. All the major loops are a part of the iteration section.
Q19. Which of the following is not related to c programming?
- conio.h
- getch()
- console.log
- All of the above
Answer. c) console.log.The console.log seems to be a command that is used mainly in a computer programming language called javascript. All other mentioned options like float and getch are a part of c programming.
Q20. What is scanf() in c programming?
- The layout of an input string
- Array
- Output function
- All of the above
Answer. a) Layout of an input string. The scanf() seems to be used with functions that help in reading formatted input data and helps in categorizing them into various data types. The scanf() can help identify what kind of data type an input seems to be.