Iteration And Files Question Preview (ID: 16334)


Review Of Loops And Files. TEACHERS: click here for quick copy question ID numbers.

An example of a bounded loop is the
a) while
b) for
c) repeat
d) do

An example of an unbounded loop is the
a) for
b) If then else
c) switch
d) do

Which loop tests the condition before executing any statements ?
a) do
b) while
c) for
d) repeat

The variable declaration for a file pointer is
a) file*fp;
b) FILE*fp
c) file*fp
d) FILE*fp;

Which closes a file?
a) fclose(fp);
b) close(fp);
c) Fclose(fp);
d) Close(fp);

Which statement checks for the end of a file?
a) Feof(fp);
b) eof(fp);
c) feof(fp);
d) Eof(fp);

The value assigned to the file pointer when there is an error in reading a file is
a) null
b) NULL
c) 0
d) -1

Which loop may be terminated by a sentinel value?
a) while
b) for
c) switch
d) if then

The first part of the fopen statement is the
a) mode
b) data type
c) size of the file
d) filename

The statement to read data from a file is
a) scanf()
b) fscanf()
c) fscan()
d) read()

Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 16334 in the upper right hand corner or click here.

TEACHERS / EDUCATORS
Log In
| Sign Up / Register