4. Write a function called oddLessEven that returns the sum of the odd valued digits minus the sum of the even valued digits in a positive integer parameter. For example, a program that uses the...


solve as simple as possible


4. Write a function called oddLessEven that returns the sum of the odd valued digits minus the sum of the even valued digits in a positive integer parameter. For example, a program that uses the<br>function oddLessEven follows. (Submit a complete C++ program that contains the main function below and your oddLessEven function in a single file.)<br>int main() {<br>cout << oddLessEven(23) << endl; // prints 1<br>cout << oddLessEven(1234) << endl; // prints -2<br>cout << oddLessEven(777) << endl; // prints 21<br>return 0;<br>}<br>

Extracted text: 4. Write a function called oddLessEven that returns the sum of the odd valued digits minus the sum of the even valued digits in a positive integer parameter. For example, a program that uses the function oddLessEven follows. (Submit a complete C++ program that contains the main function below and your oddLessEven function in a single file.) int main() { cout < oddlesseven(23)="">< endl;="" prints="" 1="" cout="">< oddlesseven(1234)="">< endl;="" prints="" -2="" cout="">< oddlesseven(777)="">< endl;="" prints="" 21="" return="" 0;="">

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here