Print float Variables
Now that we know how to print variables, let's use the same concept to print a float variable.
#include <stdio.h>
int main() {
// create float type variable
float number = 36.43;
// print the variable
printf("%f", number);
return 0;
}
// Output: 36.430000Here, we have used the format specifier %f to print the number variable (a float variable).