float da 4 byte
#include <stdio.h>
int main() {
float floatValue = 3.14f; // Step 1: Declare and initialize a float variable with a value of 3.14.
printf("Original value: %f\n", floatValue); // Step 2: Print the original float value.
// Step 3: Access the individual bytes of the float value using a pointer to char.
char bytePointer = (char )&floatValue;
// Step 4: Print the individual bytes of the float value.
printf("Byte 1: %02x\n", bytePointer[0]);
printf("Byte 2: %02x\n", bytePointer[1]);
printf("Byte 3: %02x\n", bytePointer[2]);
printf("Byte 4: %02x\n", bytePointer[3]);
return 0;
}
This program declares and initializes a float variable with a value of 3.14. It then prints the original float value and the individual bytes of the float value using a pointer to char.