Create a C program with a structure and a union with the following membe char name[10] unsigned int age char letter grade [1] char school[20]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question

Hello, Can someone help me with the following question written in C?

 

 

Create a C program with a structure and a union with the following members:
char name[10]
unsigned int age
char letter grade [1]
char school[20]
Initialise the union and the struct with suitable values and then print out the size of the union followed by the size of the
struct
Additional manual checks will be performed to verify structs and unions were used and no marks will be awarded if they
are not.
For example:
Result
20
40
Transcribed Image Text:Create a C program with a structure and a union with the following members: char name[10] unsigned int age char letter grade [1] char school[20] Initialise the union and the struct with suitable values and then print out the size of the union followed by the size of the struct Additional manual checks will be performed to verify structs and unions were used and no marks will be awarded if they are not. For example: Result 20 40
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr