this is an escape sequence (Refer this : https://www.javatpoint.com/escape-sequence-in-c)
For Pyramid: refer these URL for different patterns - https://www.programiz.com/java-programming/examples/pyramid-pattern understand the logic and convert it to apex code.
Logic is same in all OOP languages be it Apex or Java. Let me knw if help needed in this.
My bad, i thought u want numbers like 1, 1,2, 1,2,3
In that case you can do like this :
I hope it works well for you.
Thanks!
All Answers
I am able to pattern in this way: Debugs you can check, with following code:
Thanks!
but i want write code this pattern
my code should display outputin this pattern .
1
12
123
1234
12345
My bad, i thought u want numbers like 1, 1,2, 1,2,3
In that case you can do like this :
I hope it works well for you.
Thanks!
one last thing i want to ask
what is this '\n' ?
and last thing
i want display number pattern in this following way
1
12
123
1234
12345
like pyramid format
how can i write apex code ?
this is an escape sequence (Refer this : https://www.javatpoint.com/escape-sequence-in-c)
For Pyramid:
refer these URL for different patterns - https://www.programiz.com/java-programming/examples/pyramid-pattern understand the logic and convert it to apex code.
Logic is same in all OOP languages be it Apex or Java. Let me knw if help needed in this.