#include <stdio.h>
int main() {
float floatValue = 10.5f;
double doubleValue = 20.75;
printf("Float Value: %f\n", floatValue);
printf("Double Value: %lf\n", doubleValue);
return 0;
}
- Include the standard input-output header file.
- Define the
main
function. - Declare a float variable named
floatValue
and initialize it with the value 10.5. - Declare a double variable named
doubleValue
and initialize it with the value 20.75. - Use
printf
to display the value of floatValue
using the %f
format specifier. - Use
printf
to display the value of doubleValue
using the %lf
format specifier. - Return 0 to indicate successful execution.