C/c++
Expert: Zlatko - 7/17/2010
QuestionCreate a flowchart that will determine the factor of a number entered by the user. Display the number and its factorial value. Create a code afterwards.
I already did the flowchart but I am not sure whether I should use the switch-case or the if-else for coding it.
Thanks very much :D
I re
AnswerHello Veronica, create your code with if-else. Then show me the code. If it can be converted to switch-case, I'll show you the switch-case version. Then you can use which ever version you want.
The switch-case can be used if you want to check one variable for many constant values. A switch-case can always be written as if-else, but if-else cannot always be written as switch-case. The if-else is more flexible.
Best regards
Zlatko