Write a C program that prompts the user to enter some information about 2 individuals. It should then store this information in a structure. The program should then obtain the information from the structure, and output it as shown in sample run below.
Your program should include a structure with a tag name of: info. It should contain the following data as members:
a character array to store person's name, defined as: name[30]
a character array to store person's street address, defined as: address[30]
a character array to store person's city, defined as: city[20]
a character array to store person's state, defined as: state[3]
a long integer variable to store person's zip code, defined as: zip
an integer variable to store person's age, defined as: age
a character variable to store person's gender, defined as: gender
You need to define an array of type: struct info. You can call this array: people[2].
Need help on my Ansi C homework.?
This information
/* Output information back to user. */
should be contained in another fro loop.
Currently i has the value of 2 so will cause an error.
Everything else looks fine.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment