How can i use c++ to accept 10 figures of 3digit in a chronological order and print out the result in a reverse order | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i use c++ to accept 10 figures of 3digit in a chronological order and print out the result in a reverse order

21st Apr 2018, 7:41 AM
Ayobami
13 Answers
+ 1
int or float?
21st Apr 2018, 8:03 AM
Timon Paßlick
+ 1
Yes, and I want to help you. I need to know if the figures are integral or if they have a floating point.
21st Apr 2018, 8:18 AM
Timon Paßlick
+ 1
#include <iostream> #include <array> #include <algorithm> int main() { std::array<int, 10> nums; for (int& elem : nums) std::cin >> elem; std::reverse(nums.begin(), nums.end()); for (const int elem : nums) std::cout << elem << ' '; }
21st Apr 2018, 2:16 PM
Timon Paßlick
+ 1
thanks to you
21st Apr 2018, 4:28 PM
Ayobami
+ 1
No problem.
21st Apr 2018, 5:13 PM
Timon Paßlick
+ 1
Show me the compiler errors.
24th Apr 2018, 10:05 AM
Timon Paßlick
0
I want how the program will be
21st Apr 2018, 8:14 AM
Ayobami
0
because am still a learner
21st Apr 2018, 8:15 AM
Ayobami
0
the figure is in integer
21st Apr 2018, 2:02 PM
Ayobami
0
what I mean is that if the integers are 100, 200, 300, 400, 500 then the output should be in the reverse order i.e 500, 400, 300, 200, 100.
21st Apr 2018, 2:04 PM
Ayobami
0
does the code run
21st Apr 2018, 4:14 PM
Ayobami
0
really appreciate it
21st Apr 2018, 4:28 PM
Ayobami
0
this program failed to run on my system. wat may likely cause the problem. pls I need an explanation
24th Apr 2018, 9:53 AM
Ayobami