Question: WRITE THE FOLLOWING IN C (NOT JAVA OR C++) 10.8 (Using Unions) Create union integer with members char c, short s, int i and long

WRITE THE FOLLOWING IN C (NOT JAVA OR C++)

WRITE THE FOLLOWING IN C (NOT JAVA OR C++) 10.8 (Using Unions)

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 stors 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 %x 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 short 56 int 56 long 56 Breakdown in hex char 38 short 38 int 38 long 38 Enter data for type short:8 Breakdown of the element in the union char short 8 int 8 long 8 Breakdown in hex char short 8 int 8 long 8 Enter data for type int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!