Question: WRITE THE FOLLOWING IN C (NOT C++ OR JAVA) Problem 6A (5 points 10.8 (Using Unions) Create union integer with members char c, short s,
WRITE THE FOLLOWING IN C (NOT C++ OR JAVA)

Problem 6A (5 points 10.8 (Using Unions) Create union integer with members char c, short s, int i and long b. Write a program that inputs values of type char, short, int and long and stores the values in union variables of type union integer. Each union variable should be printed as a char, a short, an int and a long. Do the values always print correctly? Sample input/output. To print in hexadecimal, use 96x as the formatter. Input must be same for all cases for comparison Enter data for type char:8 Breakdown of the element in the union char 8 short 56 int 56 long 56 Breakdown in hex char 3!8 short 38 int 38 long 38 Enter data for type short:8 Breakdown of the element in the union cha short 8 int 8 long 8 Breakdown in hex char 8 short t8 int 8 long 8 Enter data for type int
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
