#include <stdio.h>
int main() {
float floatValue = 3.14f;
double doubleValue = 3.14;
printf("Float value: %f\n", floatValue);
printf("Double value: %lf\n", doubleValue);
return 0;
}
- Declare a variable
floatValue
of type float and initialize it with the value 3.14f. - Declare a variable
doubleValue
of type double and initialize it with the value 3.14. - Print the value of
floatValue
using the printf function with the format specifier %f
. - Print the value of
doubleValue
using the printf function with the format specifier %lf
. - Return 0 to indicate successful program execution.