A file mode which opens file for both reading and writing. If the file exists, its contents are overwritten. If the file does not exist, it will be created. O we O w Or Or O a O a+ Check

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 4E
icon
Related questions
Question

Please answer both questions I'll rate! 

A file mode which opens file for both reading and writing. If the file
Parson's Problem
exists, its contents are overwritten. If the file does not exist, it will be
}
created,
Rearrange the code blocks below into the proper order by dragging
printf("%s", *lines);
drop them in the yellow box below.
fclose(fptr);
#include <stdio.h>
w
Tip: The program will write and read data from a file.
fptr = fopen("r", greetings.txt");
O r
Note: NOT all of the code blocks will be used.
printf("%s", &lines);
while (fgets(lines, fptr, 50) != NULL){
Drag from here
r+
fclosed (*fptr);
while (fgets(lines, 50, fptr) != NULL){
a
fputs ("Good luck and keep safe!", *fptr);
fptr = fread ("greetings.txt","r");
a+
fptr =
fopen("w", "greetings.txt");
printf("%s", lines);
Check It!
fptr
fwrite("w", "greetings.txt");
File fptr;
fputs(fptr, "Good luck and keep safe!");
}
fclose(*fptr);
FILE *fptr;
FILE fptr;
fptr =
fopen("greetings.txt","w");
fptr
fopen("greetings.txt","r");
fputs(*fptr, "Good luck and keep safe!");
fclosed(fptr);
fputs ("Good luck and keep safe!", fptr);
Construct your solution here
fclose(fptr);
void main() {
while (fgets(50, lines, fptr) != NULL){
File *fptr;
Check It!
char lines[50];
fptr
fread("r", greetings.txt");
fptr = fwrite("greetings.txt","w");
while (fgets(fptr, 50, lines) != NULL){
O O
Transcribed Image Text:A file mode which opens file for both reading and writing. If the file Parson's Problem exists, its contents are overwritten. If the file does not exist, it will be } created, Rearrange the code blocks below into the proper order by dragging printf("%s", *lines); drop them in the yellow box below. fclose(fptr); #include <stdio.h> w Tip: The program will write and read data from a file. fptr = fopen("r", greetings.txt"); O r Note: NOT all of the code blocks will be used. printf("%s", &lines); while (fgets(lines, fptr, 50) != NULL){ Drag from here r+ fclosed (*fptr); while (fgets(lines, 50, fptr) != NULL){ a fputs ("Good luck and keep safe!", *fptr); fptr = fread ("greetings.txt","r"); a+ fptr = fopen("w", "greetings.txt"); printf("%s", lines); Check It! fptr fwrite("w", "greetings.txt"); File fptr; fputs(fptr, "Good luck and keep safe!"); } fclose(*fptr); FILE *fptr; FILE fptr; fptr = fopen("greetings.txt","w"); fptr fopen("greetings.txt","r"); fputs(*fptr, "Good luck and keep safe!"); fclosed(fptr); fputs ("Good luck and keep safe!", fptr); Construct your solution here fclose(fptr); void main() { while (fgets(50, lines, fptr) != NULL){ File *fptr; Check It! char lines[50]; fptr fread("r", greetings.txt"); fptr = fwrite("greetings.txt","w"); while (fgets(fptr, 50, lines) != NULL){ O O
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT