Ex 12) Devise a flowchart to receive a positive number and output "yes" if each of its digits is in a non-decreasing order; otherwise, output "no". For instance, if the input is 123558, the program should output "yes", because if you read the digits from left to right, the values of the digits never decrease. But, if the input is 632, the program should output "no" because 3 is not larger than 6 and 2 is not larger than 3.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 7CP: If int x = 10;, int y = 7;, double z = 4.5;, and double w = 2.5;, evaluate each of the following...
icon
Related questions
Question
Ex 12) Devise a flowchart to receive a positive number and output "yes" if each of its
digits is in a non-decreasing order; otherwise, output "no". For instance, if the
input is 123558, the program should output "yes", because if you read the digits
from left to right, the values of the digits never decrease. But, if the input is
632, the program should output "no" because 3 is not larger than 6 and 2 is not
larger than 3.
Transcribed Image Text:Ex 12) Devise a flowchart to receive a positive number and output "yes" if each of its digits is in a non-decreasing order; otherwise, output "no". For instance, if the input is 123558, the program should output "yes", because if you read the digits from left to right, the values of the digits never decrease. But, if the input is 632, the program should output "no" because 3 is not larger than 6 and 2 is not larger than 3.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning