Lectures: 1 to 9
Write a C++ program that performs the following tasks:
Use only the provided Student ID: BC123456789(In
case of not using this ID, marks will be deducted.)
Your program must take the numerical part of the given Student ID BC123456789 which is 123456789.
· Save the numerical part of the given ID in a variable.
· Double (Multiply by 2) each digit and print each doubled digit in reverse order.
· Calculate sum of all the doubled digits.
· Print the sum on screen.
Your program should use functions to complete the above tasks. You will define doubleDigits() function which will double of each digit and print, and sumOfDoubledDigits () function to calculate the sum of the doubled digits.
0 Comments