Code Snippets C

//Declaration: double atof(const char *str);
#include
#include
int main(void)
{
char j1[80], j2[80];
printf("Enter first: ");
gets(j1);
printf("Enter second: ");
gets(j2);
printf("The sum is: %lf.", atof(j1) + atof(j2));
return 0;
}
/*
Enter first: 1
Enter second: 2
The sum is: 3.000000.*/