1. Engineering
  2. Computer Science
  3. in c...

Question: in c...

Question details

In C++:
Lab Exercise Purpose In this lab, you will be using while loops and integrating it with user input. Assignment For this assignment, your while loop should continue indefinitely until the user inputs a number that is either less than or equal to 0 If that current number is divisible only by either 3, 5, or 7,your output should include an asterisk(). Look below for more information of how to output it. Some numbers will be divisible by only two of the three numbers, in which case your program should output only a tilde () instead of an asterisk or an exclamation mark. Some numbers will be divisible by all three numbers, in which case your program should output only an exclamation mark () instead of an asterisk or a tilde If a number inputted is neither divisible by 3, 5, nor 7, then the output should be This number is not divisible by 3, 5, or 7 Output If the user inputted number is divisible by only either 3, 5, or 7,your output should be the number inputted followed by aand an asterisk () Else, the output should be the number inputted followed by a This number is not divisible by 3, 5, or 7 For example Input: 10 21 105 Output: 10:* 21: 105:! Input: 2: This number is not divisible by 3, 5, or 7.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution