scanf_s("%d%c ",
& amp
);
Add a after this sentence.
getchar();
You are obviously two specifiers. How to assign a value to a variable and receive a character with %*c (but not assign a value)?
Finally, the usage of scanf_s and scanf is different and requires three parameters. The last one is the number of bytes to read (determined by sizeof).
It is recommended to replace all scanf_s in the program with scanf.
Then add it before the first line of code.
#define _CRT_SECURE_NO_WARNINGS
Shielding warning