Previous program: Predetermined Conversion Program using Switch- Case Implement
ID: 3871599 • Letter: P
Question
Previous program: Predetermined Conversion Program using Switch- Case Implement the same program functionality of the previous program that displays the pre- determined digital value of a number using the switch case selection structure.
Explanation / Answer
#include using namespace std; main() { int dignum; int num; cout > num; // this is switch case. We give a parameter to it based on which cases are further proceeded switch(num) { // case when num is 10 case 10: dignum = 1010; break; // we need to use break else it will continue to execute following cases as well. Break lets the control to get out of switch just like loops // case when num is 20 case 20: dignum = 10100; break; } }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.