Write a program that takes a four digits integer from user and shows the digits on the
screen separately i.e. if user enters 7531, it displays 7,5,3,1 separately.
#include <iostream>
using namespace std;
int main()
{
//declare variables
int number, digit;
digit=1234;
//prompt the user for input
cout <<"Please enter the 4-digit number: ";
cin >> number;
//get the first digit and disply it on screen
digit= number%10;
cout <<"The Digits are: ";
cout <<digit<<" ";
//get the remaining three digits number
number = number % 10
//get the next digit and display it
digit= number%10;
cout <<digit<<" ";
//get tje mext two digit number
number=number%10
//get the next digit and display it
digit= number%10;
cout <<digit<<" ";
//get the reamaining one digit number
number=number%10;
//get the next digit and disply it
digit=number%10
cout <<digit;