That is a stack program - I tried to change from integers to characters so when you enter a single char of a-z. I ran the program then it displayed shown below: Enter a number: to stop: a Enter a number: to stop: Enter a number: to stop: b Enter a number: to stop: Enter a number: to stop: c Enter a number: to stop: Enter a number: to stop: d Enter a number: to stop: Enter a number: to stop: e Enter a number: to stop: Enter a number: to stop: ^Z The list of numbers reversed: Code: e d c b a Press any key to continue . . . Why did it appear the output twice "Enter a number: to stop: Enter a number: to stop:"? The code is below: #include #include #include "stacksADT.h" int main (void) { int done = false; char* dataPtr; STACK* stack; stack = createStack (); while (!done) { dataPtr = (char*) malloc (sizeof(char)); printf ("Enter a number: to stop: "); if ((scanf ("%c" , dataPtr)) == EOF || fullStack (stack)) done = true; else pushStack (stack, dataPtr); } printf ("\n\nThe list of numbers reversed:\n"); while (!emptyStack (stack)) { dataPtr = (char*)popStack (stack); printf ("%3c\n", *dataPtr); free (dataPtr); } destroyStack (stack); system("pause"); return 0; }