this is one of the interview question. I am supposed to print multiple lines of output on command line, without using the newline(\n
) character in java. I tried googling for this, didn't find appropriate answers. If i am printing 5 numbers, then it should print in the following fashion. But I am not supposed to use the newline character nor loops either. I have to print this using a single println()
statement. Can you give me some ideas ? Thanks !
1
2
3
4
5