Skip to content

Can we print new lines ? #298

@HenilMistry

Description

@HenilMistry

Description

I was wondering if you can print "\n" and avoid new line on every "bol bhai".

Problem

I was trying to print this using loops!

*
* *
* * *
* * * *
* * * * *
* * * * * *

Code

// yeh wala part bhai ignore karega...
hi bhai
 // yaha pe hi likho bhai..
 bhai ye hai i = 1;
 jab tak bhai (i < 11) {
   bhai ye hai j = 0;
   jab tak bhai(j < i) {
     bol bhai "*";
     j+=1;
   }
   bol bhai "\n";
   i+=1;
 }
bye bhai
// yeh wala bhi...

Output

Somehow, I got this instead.

> *
> \n
> *
> *
> \n
> *
> *
> *
> \n
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> *
> *
> *
> *
> \n
> *
> *
> *
> *
> *
> *
> *
> *
> *
> *
> \n

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions