Close
Close

Can you explain '\n' meaning and where to use in other way ?

   Jenilg

  • '\n' is used for next line. It is used to take the cursor to next line
    - AshieshWatts

Answers

  •   

    // first write this program and run it

    void main()

    {

    int a;

    printf(“Enter the integer – ”);

    scanf(“%d”,&a);

    printf(“%d”,a);

    getch();

    }

     

    // Now write and run this program

    void main()

    {

    int a;

    printf(“Enter the integer – ”);

    scanf(“%d”,&a);

    printf(“%d”,a);

    getch();

    }

     

    // This will clear your doubts regarding this



  •   

    It can be used to go to the next line, the console moves to the next line that’s the ultimate use of it.
    Best part is with the help of “\n” the output or text in the console can be easily distinguished, you can use “\t” to create space between text also.

    Thanks!



Ask Yours
Post Yours
Write your answer