So I'm working on a c project. I had to make a loop that prompts the user to choose between 4 options. I chose the switch multi-way selection. Each option calls a function and appear some calculations to the user. There's one more option that would terminate the loop. I completed this. But there is one more thing that I have to include in the loop, and it's when the user enters any value other than the switch's cases' values, a message pops up saying "invalid value".
That message appears to the user after any option they choose. And when they do enter an invalid value, the message appears twice.
I tried placing that printf message in the switch's 'default', as well as by using if else. Same results.
I tried to change the whole switch multi-way selection to else..if. same results.