problemai what is a structureii how does a


Problem:

(a)

(i) What is a structure?

(ii) How does a structure differ from an array?

(b) Declare a structure, called account, that will contain the following data members:

account_number of type integer,
account_type of type character,
name as an array of 100 elements of type character, balance of type float.

(c) Now declare two variables, called firstaccount and secondaccount to be of type account.

(d) Now write the sample code, in C, for a user to enter the values for the data members for each structure variable.

(e) Write the sample code, in C, that will access the values entered from the user and which will display them on the screen.

(f) What is the purpose of the typedef feature? Illustrate your answer with a suitable example.

(g) What is a union? How does a union differ from a structure?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: problemai what is a structureii how does a
Reference No:- TGS0360731

Expected delivery within 24 Hours