Question: in c++ please Write a complete program that reads three nonnegative integers from the console and outputs the number of distinct values entered. For example
Write a complete program that reads three nonnegative integers from the console and outputs the number of distinct values entered. For example if the input is 345523 then the output will be 3 , since there are three distinct values. If the input is 427842 then the output will 2 aince there are two distinct values. Finally, if the input is 676767 then the output will be 1 since there is just one distinct value. Special case: If any of the integers is negative th en the output will be - 1 to signify an error
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
