get float in c

#include <stdio.h>

int main() {
    float num;

    // Prompt the user to enter a float
    printf("Enter a float number: ");

    // Read the float from the user
    scanf("%f", &num);

    // Display the entered float
    printf("You entered: %f\n", num);

    return 0;
}