Question: Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop that outputs each element in numbersList

Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop that outputs each element in numbersList that is divisible by 9, and adds 1 to each divisible by 9 element. End each output with " is corrected to a number not divisible by 9" followed by a newline.
Ex: If the input is 3 36 54 23, then the output is:
Original numbers: 36 54 23
36 is corrected to a number not divisible by 9
54 is corrected to a number not divisible by 9
Nearest numbers not divisible by 9: 37 55 23
-----------------------------------------------------------------------------------------------------------
#include
int main() { int numElements; unsigned int i; vector \\ Enter Your Code Here in C++ (Thank you!) cout Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop tha outputs each element in numbersList that is divisible by 9 , and adds 1 to each divisible by 9 element. End each output with " is corrected to a number not divisible by 9" followed by a newline. Ex: If the input is 3365423 , then the output is: Original numbers: 365423 36 is corrected to a number not divisible by 9 54 is corrected to a number not divisible by 9 Nearest numbers not divisible by 9: 375523
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
