If you wanted to get numbers you could try something like this. I will add a disclaimer that I have not run this code past anybody, to see if it is ok, so I would appreciate any criticism of the code, so I can improve it if necessary. thanks
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void getline(char line[], int len);
int main(void)
{
char text[40];
double x = 0.0;
double y = 0.0;
printf("\n\nEnter some text: ");
getline(text, 40);
x = atof(text);
printf("Enter some more text: ");
getline(text, 40);
y = atof(text);
printf("\n%.2f minus %.2f equals: %.2f\n\n", x, y, x - y);
return 0;
}
void getline(char line[], int len)
{
char buf[len];
char *p;
fflush(stdout);
fgets(buf, sizeof buf, stdin);
if ((p = strchr(buf, '\n')) != NULL) {
*p = '\0';
strcpy(line, buf);
}
}