Input and Output

float and double Output

#include <stdio.h>
int main()
    float number1 = 13.5;
    double number2 = 12.4;

    printf("number1 = %f\n", number1);
    printf("number2 = %lf", number2);
    return 0;


number1 = 13.500000
number2 = 12.400000

To print float, we use %f format specifier. Similarly, we use %lf to print double values.

Leave a Reply

Your email address will not be published. Required fields are marked *