cast from float to long c

#include <stdio.h>

int main() {
    float floatNumber = 12.345;
    long longNumber;

    // Step 1: Assign the float value to the long variable, which triggers a float-to-long conversion.
    longNumber = (long)floatNumber;

    // Step 2: Print the original float value and the converted long value.
    printf("Original float value: %f\n", floatNumber);
    printf("Converted long value: %ld\n", longNumber);

    return 0;
}