Question: Write the Code in C for the following functions. char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float

Write the Code in C for the following functions.Write the Code in C for the following functions. char bits_int(float f)

char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float as a char. You should call bits_int to get the bits in an int and return '1' if the sign is negative else return '0'The function should accept a float and return a string. Write a function that returns the sign of a float as an integer. You should call bits_int to get the bits in an int and return -1 if the sign is negative else return 1. The function should accept a float and return an int. 1% Write a function to return a string containing the actual binary value of the exponent of a float in a char array. You should call bits int to get the bits in an int and return the string Example: for f =-15.375 n = 11000001011101100000000000000000 the exponent bits are "10000010" The function should accept a float and return a string char bits_int(float f) return *(int*)&f; 1% Write a function that returns the sign of a float as a char. You should call bits_int to get the bits in an int and return '1' if the sign is negative else return '0'The function should accept a float and return a string. Write a function that returns the sign of a float as an integer. You should call bits_int to get the bits in an int and return -1 if the sign is negative else return 1. The function should accept a float and return an int. 1% Write a function to return a string containing the actual binary value of the exponent of a float in a char array. You should call bits int to get the bits in an int and return the string Example: for f =-15.375 n = 11000001011101100000000000000000 the exponent bits are "10000010" The function should accept a float and return a string

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!