Question 3 10 Marks Shown Figure 2 Contain Marks Name U Given Input File Datatxt Shown Fig Q43783862
Question 3 (10 marks) as shown in Figure 2 which contain marks and name u Given the input file “data.txt” as shown in Figure 2 students. All the following questions, (a) to (e) are relate 45.0 Ahmad 75.5 John 55.0 Salma Figure 2: file data.txt Ahmad 45.0 John 75.5 Salma 55.0 Figure 3: file result.out [1 m) file variable. write C statements to declare pointer fin as an input file variable and fout as an output [1 m] D) Write C statement to open the existing file “data.txt” for reading and writing. [1 m) c) Write C statement to open output file “result.out” for appending. d) Write C statements to read all the data from file “data.txt”, store to the variable name and mark and then, display all the data in the output file “result.out” as shown in Figure 3. [3 m] e) What is the content of the file “result.out” after the execution of the program segment [4 m) 3.12 1/program segment 3.1 for (int i=1; i<8; i++) {1E (182==0) printf(“n%d”, 2*i); else Eprint£ (£out, “ní – d”, 3*1); Show transcribed image text Question 3 (10 marks) as shown in Figure 2 which contain marks and name u Given the input file “data.txt” as shown in Figure 2 students. All the following questions, (a) to (e) are relate 45.0 Ahmad 75.5 John 55.0 Salma Figure 2: file data.txt Ahmad 45.0 John 75.5 Salma 55.0 Figure 3: file result.out [1 m) file variable. write C statements to declare pointer fin as an input file variable and fout as an output [1 m] D) Write C statement to open the existing file “data.txt” for reading and writing. [1 m) c) Write C statement to open output file “result.out” for appending. d) Write C statements to read all the data from file “data.txt”, store to the variable name and mark and then, display all the data in the output file “result.out” as shown in Figure 3. [3 m] e) What is the content of the file “result.out” after the execution of the program segment [4 m) 3.12 1/program segment 3.1 for (int i=1; i
Expert Answer
Answer to Question 3 (10 marks) as shown in Figure 2 which contain marks and name u Given the input file “data.txt” as shown in Fi…
OR