C++ Files Review

C++ Files Review

9th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

File Extensions

File Extensions

5th - 9th Grade

10 Qs

FILE HANDLING IN PYTHON

FILE HANDLING IN PYTHON

12th Grade

10 Qs

KIỂU DỮ LIỆU TỆP

KIỂU DỮ LIỆU TỆP

11th Grade

11 Qs

File Handling-1

File Handling-1

12th Grade

10 Qs

Python Basic files

Python Basic files

10th - 12th Grade

10 Qs

Unit 1 Jan 2017 Question 4 preparation

Unit 1 Jan 2017 Question 4 preparation

11th Grade

10 Qs

Kiểm tra tin (16 câu)

Kiểm tra tin (16 câu)

11th Grade

5 Qs

MOAC Word 2016 Lesson 1

MOAC Word 2016 Lesson 1

8th Grade - University

10 Qs

C++ Files Review

C++ Files Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Ferhat Travaci

Used 3+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which C++ library allows us to work with files?

filestreams

fstream

string

vector

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class from the fstream library is used to create and write to files?

ifstream

ofstream

fstream

filemanager

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code. What will it do?

Reads from filename.txt

Creates a file but does not write anything

Creates a file named filename.txt and writes 'Writing to a file.' into it

Outputs 'Writing to a file.' on the console

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class would you use to read from a file in C++?

ofstream

fstream

ifstream

filemanager

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code. What does it do?

Reads the content of filename.txt and prints it on console

Writes 'filename.txt' to the console

Creates a file called filename.txt

Deletes filename.txt

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of the ifstream class in C++?

To write data to files

To read data from files

To delete files

To manage file permissions

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to open a file for reading in C++?

ofstream file('example.txt');

ifstream file('example.txt');

fstream file('example.txt', ios::out);

filemanager file('example.txt');

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

If the input.txt file has the following numbers:

123 245 58 187 231 456 217

what will be the written into the output.txt file after the execution of the following program?

123 187 231 217

123 245 187 231 217

245 58 456

58 456