// Name:    Chan Yuk Ting
// No.:     240374028
// Class:   EG114403/1B
// Program: 1B_Ex2_Q1_ChanYukTing.ino

int num = 13579;    //iput a number

void setup() {
  Serial.begin(115200);
}

void loop() {
  int digit;
  while (num > 0) { //if the condition is correct, run the below code
    digit = num % 10; //get the last number
    num /= 10; //refresh the number to last 2nd place
    Serial.print(digit);  //print the digit and go back to the while statement
  }
  while (1);  //stop running the code
}