 
			 
			MCQOPTIONS
 Saved Bookmarks
				This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. | Note:Includes all required header filesusing namespace std; int main () { char fine, course; cout << "Enter a word: "; fine = cin.get(); cin.sync(); course = cin.get(); cout << fine << endl; cout << course << endl; return 0; } 10.ios::trunc is used for ? | 
| A. | If the file is opened for output operations and it already existed, no action is taken. | 
| B. | If the file is opened for output operations and it already existed, then a new copy is created. | 
| C. | If the file is opened for output operations and it already existed, its previous content is deleted and replaced by the new one. | 
| D. | None of the above | 
| E. | |
| Answer» D. None of the above | |
| 2. | Note:Includes all required header filesusing namespace std; int main () { int l; char * b; ifstream i; i.open ("find.txt", ios :: binary ); i.seekg (0, ios :: end); l = i.tellg(); i.seekg (0, ios :: beg); b = new char [l]; i.read (b, l); i.close(); cout.write (b, l); delete[] b; return 0; } 9.What is the output of this program? | 
| A. | course | 
| B. | fine | 
| C. | Returns fine 2 letter or number from the entered word | 
| D. | None of the mentioned | 
| Answer» D. None of the mentioned | |
| 3. | Which is correct syntax ? | 
| A. | myfile:open ("example.bin", ios::out); | 
| B. | myfile.open ("example.bin", ios::out); | 
| C. | myfile::open ("example.bin", ios::out); | 
| D. | myfile.open ("example.bin", ios:out); | 
| Answer» C. myfile::open ("example.bin", ios::out); | |
| 4. | Which of the following methods can be used to open a file in file handling? | 
| A. | Using Open ( ) | 
| B. | Constructor method | 
| C. | Destructor method | 
| D. | Both A and B | 
| Answer» E. | |
| 5. | Which of these is the correct statement about eof() ? | 
| A. | Returns true if a file open for reading has reached the next character. | 
| B. | Returns true if a file open for reading has reached the next word. | 
| C. | Returns true if a file open for reading has reached the end. | 
| D. | Returns true if a file open for reading has reached the middle. | 
| Answer» D. Returns true if a file open for reading has reached the middle. | |
| 6. | Which stream class is to only write on files ? | 
| A. | ofstream | 
| B. | ifstream | 
| C. | fstream | 
| D. | iostream | 
| Answer» B. ifstream | |