i am a beginner in c++ nd i have a program in my book like this . plz tell how to make it !

write a program that inputs a five-digit integer, separates the integer into its digits and prints them seperated by three spaces each. [hint ; use integer division and modulus operators] , for example: if user enters 42339 then program should print
_________________
4 2 3 3 9
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
int arr[5];
cout << "Input your numbers:" << endl;
for (int i = 0;i < 5; ++i)
cin >> arr[i];

for (int i = 0; i < 5; ++i)
cout << arr[i] << setw(3);

cout << endl;
return 0;
}
Topic archived. No new replies allowed.