atof - Converts String to float value in C

//atof - Converts String to float value
#include<stdio.h>
#include<stdlib.h>

int main ()
{
    double a,b;
    char buffer [256];
    printf ( "Enter a Number: " );
    gets (buffer);
    a = atof (buffer);
    printf ( "Printing a Float Number  %f" , a );
        return 0;
}


Output
Enter a Number : 4
Printing a Float Number 4.0000