Question: Code in C Lab 10 File IO Write two programs to write first and last names of people. The pro follows: and read from file
Lab 10 File IO Write two programs to write first and last names of people. The pro follows: and read from file the age and grams should work as 1. The first program reads strings containing first and last names and saves them in a text file (this should be done with the fprintf function). The program should take the name of the file as a command line argument. The loop ends when the user enters 0 This program reads and saves ages and names . Enter person (age, first last) :40, John Smith Enter person (age, first last) :32 Bil1 Jones Enter person (age, first last):0 in a binary file 2. The second program reads in from the text file above (with the fscanf function) and prints out the ages and names on the screen. The program should take the name of the file as a command line argument. This program prints ages and names from a text file. Name: 40, John Smith Name: 32, Bill Jones Algorithm design process 1. First program: a. Declare needed variables. b. Use command line arguments to open the file specified by the user for writing c. Enter the prompt and read the information from the user d. In a loop (until the user enters 0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
