Posts Draw The Triangle 2
Post
Cancel

Draw The Triangle 2

Draw The Triangle 2

1
2
3
4
5
* 
* * 
* * * 
* * * * 
* * * * *
  • Write a query to print the pattern P(20).
  • MySQL Solution
1
2
3
4
set @number = 0;
select repeat('* ', @number := @number + 1) 
from information_schema.tables
where @number < 20
This post is licensed under CC BY 4.0 by the author.