CS201 QUIZ NO 1 SOLVED || 100% VERIFIED BY ADMIN || VURANK

CS201 QUIZ NO 1 SOLVED 100% VERIFIED BY ADMIN (MID TERM SYLLABUS)

Q1: ofstream is used for __________.
A) Input file stream
B) Output file stream (100% Sure)
C) Input and output file stream
D) All of the given

Q2: Base address is the memory address of __________ element of an array.
A) 1st (100% Sure)
B) 2nd
C) 3rd
D) 4th

Q3: All elements of an array must be of __________ data type(s).
A) char and int
B) Same (100% Sure)
C) Different
D) float and double

Q4: eof is used to check for the __________ of file when a file is being read.
A) Start
B) End (100% Sure)
C) Middle
D) Name

Q5: While handling files, one can have __________ options.
A) read the file
B) write in some file
C) read and write in the same file
D) All of the given (100% Sure)

Q6: Which of the following is true about streams?
A. It is a sequence of bytes
B. It is an ordered sequence
C. All bytes can go through the stream simultaneously
D. Bytes that enters first into the stream will go out at last
A) A only
B) C only
C) A and B (100% Sure)
D) A and D

Q7: we have opened a file stream myfile for reading(getting), myfile.tellg() gives us the current get position of the file pointer. It returns a whole number of type __________.
A) long (100% Sure)
B) int
C) short
D) double

Q8: Null Character is represented by __________ in C++.
A) /0
B) \0 (100% Sure)
C) \n
D) \t

Q9: suppose we have int y[10];
To access the 4th element of the array we write.
A) y[4];
B) y[3]; (100% Sure)
C) y[2];
D) None of given

Q9: What will be the size of the array declared as int array[1000];
A) 999
B) 1000
C) 1001 (100% Sure)
D) 1002