I have java background but I am new to C programming and this is my first HW assignment so forgive me if this is a simple fix. I need to ask a customer what their name is & what they want to buy. I began like this:
#include <stdio.h>
#include <stdlib.h>
#define TSHIRT 18.95
#define CHIPS 1.79
#define COKE 2.99
#define TAX 0.06
#define DEPOSIT 1.20
int main(void) {
printf("Hello customer! What shall I call you?");
char name[20];
scanf("%s",name);
printf("Okay %s, here is what we have to offer:",name);
return EXIT_SUCCESS;
}
When the program runs, it only shows very briefly on the console then disappears leaving the console blank. What is the reason why?