Code:
do { /* Put the whole program in a do-while loop */
char ch; /* This can be whatever you want, the variable to hold your chosen character */
.
. /* Do your stuff */
.
ch = getchar(); /* Get the character from the user and assign it to ch */
{
while ( ch != 'E' || ch != 'e' ); /* If the character from the user is E or e, the loop will stop */
printf( "%d", total );
return 0; /* The program ends once the loop is exited */
You get your character at the end of the loop so that you won't print it before the test.