#include <stdio.h>
int main() {
float number = 3.14;
printf("The value of the float variable is: %f", number);
return 0;
}
#include <stdio.h>
: This line includes the standard input-output header file in the C program.
int main() {
: This line declares the main function where the execution of the program begins.
float number = 3.14;
: This line declares a variable named number
of type float and initializes it with the value 3.14.
printf("The value of the float variable is: %f", number);
: This line prints the value of the float variable to the console using the printf
function. The %f
is a format specifier for a float variable.
return 0;
: This line indicates the end of the main function and returns a status code of 0 to the operating system, indicating successful execution of the program.