Okay I changed it around a little bit...
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int x;
char input1 = 'E';
double error;
printf("\n\nEnter E to calculate error\n");
printf("Enter Q to quit program\n");
scanf("%c", &input1);
while( input1 != 'Q' )
{
if ( input1 == 'E' )
{
printf("\nEnter a value for x: ");
scanf("%d", &x);
error = abs(1+x - exp(x));
printf("error is: %lf\n\n", error);
}
else
{
printf( "\nERROR! Please try again!\n\n" );
}
}
return 0;
}
Let me know if this makes sense.
Thanks for the help!!