loops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

loops

So i need to do an assignment. It asks us to create a program where the user inputs a number between 1 and 5 and it sends them to either an addition, subtract, multiple, division, or to quit the program. I am asking help and how to do this assignment. I will post my code later because i am at work with my dad. Thank you

15th Jul 2017, 3:00 AM
Raul Garrido
Raul Garrido - avatar
1 Answer
+ 1
You can use switch case for this. Take the input and depending on the number user provides you could do addition in case 1,subtraction in case 2 and so on(exit(0) in case 5). You can practise switch conditions in sololearn's C++ lessons. Hope it helps.
15th Jul 2017, 3:40 AM
Debakar Roy
Debakar Roy - avatar