Q#1: We use ___ to open a file or stream for extraction
(A) in *
(B) out
(C) open
(D) read
Answer: (A) in
Q#2: Null character is represented by ___ in C++
(A) /0
(B) \0 *
(C) \n
(D) \t
Answer: (B) \0
Q#3: An object of ___ class can be created for saving the current position of any opened file before reading from the file
(A) Streampos *
(B) fstream
(C) ofstream
(D) ifstream
Answer: (A) Streampos
Q#4: ___ returns true if c is a digit or a letter and false otherwise
(A) isalpha
(B) isdigit
(C) isalnum *
(D) isspace
Answer: (C) isalnum(int c)
Q#5: We use ___ to open a file or stream for insertion
(A) in
(B) out *
(C) open
(D) write
Answer: (B) out
Q#6: Base address is the memory address of ___ element of an array
(A) 1st *
(B) 2nd
(C) last
(D) middle
Answer: (A) 1st
Q#7: ___ allow us to have a memory location and use it as int or char interchangeably
(A) structures
(B) unions *
(C) classes
(D) arrays
Answer: (B) union
Q#8: To read command-line arguments, the main() function itself must be given ___ arguments
(A) 0
(B) 1
(C) 2 *
(D) 3
Answer: (C) 2
Q#9: Individual characters in a string stored in an array can be accessed directly using array ___
(A) manipulation
(B) subscript *
(C) pointer
(D) reference
Answer: (B) subscript
Q#10: To manipulate n-dimensional array ___ nested loops are required
(A) n
(B) n-1 *
(C) n+1
(D) 1
Answer: (B) n-1
Q#11: A character is stored in the memory in
(A) string
(B) ASCII *
(C) Unicode
(D) integer
Answer: (B) ASCII
Q#12: What will be the size of following array? int arr[29];
(A) 29 *
(B) 30
(C) 18
(D) 32
Answer: (A) 29
Q#13: We use ___ to open a file or stream for extraction
(A) in *
(B) out
(C) open
(D) read
Answer: (A) in
Q#14: We use ___ to open a file or stream for insertion
(A) in
(B) out *
(C) open
(D) write
Answer: (B) out
Q#15: ___ are conventional names of the command line parameters of the main() function
(A) argc and argv *
(B) in and out
(C) fstream and ifstream
(D) input and output
Answer: (A) ‘argc’ and ‘argv’
Q#16: In ___, we have different data members and all of these have their own memory space
(A) structures *
(B) unions
(C) classes
(D) arrays
Answer: (A) structures
Q#17: How we declare an array of integer data whose size is 20 with array name “count”
(A) int count[20]; *
(B) int count(20);
(C) int count;
(D) int[20] count;
Answer: (A) int count[20];
Q#18: A ___ is an array of characters that can store number of character specified
(A) String *
(B) File
(C) Pointer
(D) Array
Answer: (A) String
Q#19: A function is a block of statements that can be defined once and used in the program
(A) One time
(B) Two times
(C) Three times
(D) As many times as user wants *
Answer: (D) As many times as user wants
Q#20: What will be the output of the following while loop?
(A) 1 2 3 4
(B) 1 2 3 4 5
(C) Compile time error
(D) Infinite loop *
Answer: (D) Infinite loop
Q#21: We can access a global variable
(A) From the functions only
(B) From the loops only
(C) From the main() function only
(D) From anywhere in the program *
Answer: (D) From anywhere in the program
Q#22: A repetition statement specifies that an action is to be continued while some ___ remains true
(A) Condition *
(B) Control
(C) Assignment
(D) Operator
Answer: (A) Condition
Q#23: Loops are ___ Structure
(A) Decision
(B) Sequential
(C) Repetition *
(D) None of the given options
Answer: (C) Repetition
Q#24: ___ operator is used to pass the address of a variable in call by reference method
(A) %
(B) +
(C) @
(D) & *
Answer: (D) &
Q#27: By default, the starting index of an array in C++ is
(A) 2
(B) -1
(C) 0 *
(D) 1
Answer: (C) 0
Q#28: A variable declared within a code block becomes ___ variable for that block
(A) Static
(B) Integer
(C) Local *
(D) Global
Answer: (C) Local