C Program to demonstrate the ‘atof’ and ‘gets’ functions.
Converting strings to numbers is a fundamental task in C — every value read from scanf, fgets, or command-line arguments arrives as a string and must be explicitly converted. The standard library in <stdlib.h> provides three simple conversion functions: atoi() (string to int), atol() (string to long), and atof() (string to double/float). For robust error …