Write a C++ program that collects the value of the variable x via keyboard.

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

1. [6 marks] Write a C++ program that collects the value of the variable x via keyboard. The variable x is defined as long. Your program will remove every digit in x and will place it in a position of the array, such that the rightmost digit will go in position 0 and so on. As you don’t know how many digits the long value has, assume it won’t have more than 10 digits. You will need to keep track of the total number of digits extracted, so that you know how many positions the resulting array will have. Display the original value before it gets transferred to the array and the value coming from the array. Both values as expected to look the same when displayed. E.g., Original value: 1254, Value in the array: 1254.
2. [6 marks] Reusing what you completed in the previous item, implement a C++ function that takes a long value and generates a new value with all the digits from the original value inverted. Use the array, as in the previous exercise, to extract the digits. Once the digits are in the array, send them to a long variable in the reverse order. Display outputs as: Original value: 1254, New value: 4521.

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services