Write a C++ program as follows: 1. write the function size t sumofdigits( int n ) which receives an integer, then return
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a C++ program as follows: 1. write the function size t sumofdigits( int n ) which receives an integer, then return
1. write the function size t sumofdigits( int n ) which receives
an integer, then returns the sum of its digits
2. write the main() function with a while loop where
(a) ask the user Enter an integer:
(b) use the function above function to compute and print the sum
of digits.
Instructions. 1. work each question on ide.ca50.10. 2. work in the folder tests and save ench file us t1.cpp, t2.cpp, etc Test questions. 1. Write a C++ program as follows: 1. write the function size t eumofdigita( int n ) which receives an integer, then returns the sum of its digits 2. write the main() function with a while loop where (a) ask the user Enter an integer: (U) use the function above function to compute and print the sum of digits. 2. Write a C++ program as follows: 1. write the function size-t allvowels( const string& s ) that counts the number of vowels and semivowels aeiouwyAEIOUHY 2. write the main() function with a while loop where (sx) ask the user Enter a string: (b) use the function above function to print the numbers of vowels and semivowels. 3. Write a C++ program as follows: 1. write the function string toupper( const string& 2 ) which constructs the uppercase version of the the strings and returns it; 2. write the main() function with a while loop where (a) ask the user Enter a string: (b) use the function above function to construct and print the uppercase string. Page 1/2