SerialPrint. Need help

How can i print it in a Serial monitor in 1 line only?

Output:
“Enter Date
Month = 12
day = 2
Year = 1
The Date is:
94”
Expected Output is:
Enter Date
Month = 12
day = 2
Year = 1
The Date is:
12 2 1

// use unsigned long if higher values
int number = 0;
void setup () {
  Serial.begin(9600);
  delay(50);
  Serial.println("Enter Date");
}
void loop () {
  Date ();
}
void Date () {
  int mm;
  int m;
  number = getnumber ();
  mm = number;
  Serial.print ("Month = ");
  Serial.println (mm);

  int dd;
  number = getnumber ();
  dd = number;
  Serial.print ("day = ");
  Serial.println (dd);

  int yy;
  number = getnumber ();
  yy = number;
  Serial.print ("Year = ");
  Serial.println (yy);
  PrintDate ();
}
void PrintDate () {
  int mm;
  int dd;
  int yy;
  Serial.println ("The Date is: ");
  Serial.println(mm + '/' + dd + '/' + yy);
}
int getnumber (void) {
  number = 0;
  while (Serial.available () > 0 ) {
    Serial.read ();
    delay(50);
  }
  while (Serial.available () == 0) {  }
  while (Serial.available () > 0) {
    byte ch = Serial.read ();
    if (ch >= '0' && ch <= '9') {
      number = (number * 10) + (ch - '0');
      delay(5);
    }
    else {
      Serial.println("Invalid");
      return getnumber ();
    }
  }
  return number;

}

try replacing all "println" with "print" and in your loop add Serial.println (""); after "Date()"

I want the Variable of mm,dd,yy go to
Serial.println (mm + dd + yy), is that possible and how?

You could make up a string, but it is easy to

Serial.print(day):
Serial.print(":");
Serial.print(month);
Serial.print(":");
Serial.println(year);

Im trying to set the time in the rtc. that’s why i need the variables mm, dd,yy to put it the "Serial.println (mm +dd+ yy) like that so i can check if code is correct…

The problem is that i cant set the time in the serial monitor.

Here’s the sample code.
Still dont know how to manipulate stored variables.

#include <DS3231.h>
DS3231 rtc(SDA, SCL);

int number = 0;
void setup () {
  Serial.begin(9600);
  rtc.begin ();
  delay(50);
  Serial.println("Enter Date");
}
void loop () {
  if (Serial.available () > 0) {
    int ch = Serial.read ();
    Date ();
  }
}
void showTime () {
  Serial.print(rtc.getDOWStr());
  Serial.print(" ");
  Serial.print(rtc.getDateStr());
  Serial.print(" -- ");
  Serial.println(rtc.getTimeStr());
}
void Date () {
  int mm;
  int dd;
  int yy;

  number = getnumber ();
  mm = number;
  Serial.print ("Month = ");
  Serial.println (mm);

  number = getnumber ();
  dd = number;
  Serial.print ("Day = ");
  Serial.println (dd);

  number = getnumber ();
  yy = number;
  Serial.print ("Year = ");
  Serial.println (yy);

  PrintDate ();
}
void PrintDate () {
  int mm;
  int dd;
  int yy;
  Serial.println ("The Date is Set to: ");
  Serial.println(mm + '/' + dd + '/' + yy);

  rtc.setDate(mm, dd, yy);

}
int getnumber (void) {
  number = 0;
  while (Serial.available () > 0 ) {
    Serial.read ();
    delay(50);
  }
  while (Serial.available () == 0) {  }
  while (Serial.available () > 0) {
    byte ch = Serial.read ();
    if (ch >= '0' && ch <= '9') {
      number = (number * 10) + (ch - '0');
      delay(5);
    }
    else {
      Serial.println("Invalid");
      showTime();
      return getnumber ();
    }
  }
  return number;
}

There is a simple method here Do You Have The Time? DS1307 RT Clock + Arduino – bildr