#include int ask_for_integer(char prompt[]) { int a; printf("%s", prompt); scanf("%d",&a); return a; } double ask_for_double(char prompt[]) { double d; printf("%s", prompt); /* ** Originally, the line below was scanf("%g", &d); ** This would work if d was a float, but d is a double so the lg ** specification is needed (i.e. long float) */ scanf("%lg", &d); return d; }