CS201 Midterm MCQs 50
CS201 Midterm MCQs 50
A) int
B) float
C) string
D) integer
Answer: D
Q2: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q5: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q7: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
Q9: What is the correct syntax to declare a function in C++?
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q10: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q12: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q15: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q17: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q20: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q22: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q25: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q27: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q30: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q32: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
Q34: What is the correct syntax to declare a function in C++?
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q35: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q37: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q40: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q42: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q45: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A
A) int
B) float
C) string
D) integer
Answer: D
Q47: What is the size of an int data type in most modern compilers?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) Compiler dependent
Answer: B
A) for loop
B) while loop
C) do-while loop
D) None of these
Answer: C
A) return_type function_name();
B) return_type (function_name);
C) function_name return_type();
D) None of these
Answer: A
Q50: Which of the following header files is required to use input/output streams?
A) <iostream>
B) <inputoutput>
C) <stream>
D) <fstream>
Answer: A