We have an assignment in class to convert from Decimal to single precision using c and I'm completely lost.
This is the assignment:
The last part of this lab involves coding a short c algorithm. Every student must create a program that gets a scientific notation floating point number as an input and prints it´s IEE754 single precission value both in binary and hexadecimal.
The ouput of the program must be equal to the following : “Introduce a float point number in decimal (scientific notation): The decimal float 1.234500e-04 is 3901725B in hexadecimal (IEEE 754). “
The #includes we have learnt so far are: stdio.h, math.h and string.h, so I don't think we are allowed to use any other includes. Also we havnt learned struct
or union
or any of that yet, because I saw those in other examples and I didn't understand anything.
I would really appreciate it if someone can guide me through making this code!