Help...Can anyone give me an example program in c++ that computes the area and Perimeter of a triangle using switch statement.
@kris100 I won't give you the correct code unless you show me that you did take some initiative to solve the problem on your part. Because if I write the code for you, you'll learn nothing. So show how much you have written, then we may discuss the errors, corrections etc.
A switch statement is an n-way branch. Fancy term, but it can be done with a series like: if( variable == x ) {} else if( variable == y ) {} else if( variable == z ) {} else {} Beyond this, you need to ask a more specific question.
Why would you want to do that?....Am curious. There are much better ways of doing this.
@jlvm he wants the switch statement to create menus.
oh.. sorry for the late response guys,. i finished this problem, and hopefully it worked well.lol thanks for your concern replying on my problem..
Join our real-time social learning platform and learn together with your friends!