Serial monitor not displaying anything.

i had written a code to find if a given year is a leap year or not after the user enters the data to the serial monitor. But after sending the year(to be found if its leap or not) the serial monitor does not display anything.
the baud rate of serial monitor is 9600 and no error is displayed by the compiler and the arduino was also connected and the code uploaded.
The size of the sketch is 2788 bytes.

The code file is attached.

sketch_jun04b.ino (1.64 KB)

Make sure you turn on line ending in serial monitor.

    bufferCount = ReadLine(myData);Questions for you.

Does calling ReadLine() update the myData array ? Try printing it when each character is read from Serial and see what you get.

  while (true) 
    if (Serial.available() > 0) 
      c =;
      if (c != '\n') {
        str[index++] = c;
        str[index] = '\0';  // null termination character

Will the while condition ever be false and end the while loop, thus exiting the ReadLine() function ?

Changing the line ending to new line worked. That was a silly mistake wasn't it? Thanks