Question: Please write it in C++ Important requirements for all questions: No global variable is allowed to be declared and used. Constants are ok. Functions cannot
Write a function named "readNumUntilRepeated" that reads in a list of numbers until the user repeats the last or first number. It will return the total count of numbers the user has entered and the value of the first and last numbers. Please note that first or last number should be counted only once. When the user ends the list with the first number, the last number will be the last one before that number. Note: this function will use "cout" to prompt and "cin" to read in the numbers, but it will return the values to the caller. Here is an example of a test call: int value =0, first =0, last =0; cout "Count: " readNumUntilRepeated(first, last) endl ; cout "Value of the first number: "
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
