void reverse function

How would you develop a program that inputs a five digits integer, separates the integer into its individual digits and prints the digits separated from one another by one space each in the reverse using function. The function void reverse(int) must be used?
try something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
using namespace std;

int main()
{
     char input[5];
     cin >> input;
     cout << '\n';
     for (int i=4; i<=0; i--)
     {
          cout << input[i] << ' ';
     }

     return 0;
}
Congratulations, Bazzy.
You have failed the Internet, programming, and text interpretation in a single post.
Topic archived. No new replies allowed.