Computers and Technology
Create union integer with members char c, short s, int i and long b. Write a program that inputs the 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. D the values always print correctly? Also create pseodocode or flowchart.Here is the feedback that I received when I originally turned this in:I have the following concerns: You need to save your program file with a .c extension. You should declare your union above the main module and then utilize it from within this portion. You have declared the union and then created a function definition prior to entering the main() function.Here is the original code provided by homework help: Thanks in advance#include union myUnion {char c;short s;int i;long l;};void print(myUnion u) {printf("As a character: %c\n", u.c);printf("As a short: %hd\n", u.s);printf("As an int: %d\n", u.i);printf("As a long: %ld\n\n", u.i);}int main() {myUnion u;printf("Please enter a character: ");scanf("%c", &(u.c));print(u);printf("Please enter a short: ");scanf("%hd", &(u.s));print(u);printf("Please enter an int: ");scanf("%d", &(u.i));print(u);printf("Please enter a long: ");scanf("%ld", &(u.l));print(u);return 0;
Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to use the apply method to get a new DataFrame named result_df with a new column AVG. The AVG column should average the float values across P2010 to P2015. The apply method should also remove the 6 original columns (P2010 to P2015). For that, what should be the value of x and y in the given code?frames = ['P2010', 'P2011', 'P2012', 'P2013', 'P2014', 'P2015'] df['AVG'] = df[frames ].apply(lambda z: np.mean(z), axis=x) result_df df.drop(frames, axis=y) a. x = 1 y = 0.b. x = 1 y = 1.c. x = 0 y = 1.d. x = 0 y = 0.