Posts Draw The Triangle 1
Post
Cancel

Draw The Triangle 1

Draw The Triangle 1

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