Hi everyone I\'m almost finish with this assignment and i need help with this qu
ID: 3586690 • Letter: H
Question
Hi everyone
I'm almost finish with this assignment and i need help with this question . I'll appreciate your help. Thanx U.Please respond in C language (not c++)
Write a switch statement that tests the value of the variable AptNum and performs the following actions: if AptNum is 101, the message "First Floor" is printed if AptNum is 202, the message "Second Floor" is printed. if AptNum is 303, the message "Third Floor" is printed for any other value of AptNum, the message "Lucky You, it's the Penthousel" is printed.Explanation / Answer
Answer:
switch(AptNum) {
case 101: printf("First Floor "); break;
case 102: printf("Second Floor "); break;
case 103: printf("Third Floor "); break;
default: printf("Lucky You, It's the Penthouse! ");
}
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.