`{"id":"f8e1424e-d4e2-4495-be3d-e16e237f7cff","name":"Pattern 4","description":"<p>1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format.</p>","inputFormat":"A number n","outputFormat":"<img src=\"http://pepcoding.com/resources/ojquestionresource/images/pat41.JPG\" alt=\"pat41\">","constraints":"1 &lt;= n &lt;= 100","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int n;\r\n cin >> n;\r\n\r\n //write your code here\r\n\r\n}"},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n\r\n // write ur code here\r\n\r\n }\r\n}"},"python":{"code":"n = int(input())\n#write your code here"}},"points":10,"difficulty":"easy","sampleInput":"5","sampleOutput":"*\t*\t*\t*\t*\t\r\n\t*\t*\t*\t*\t\r\n\t\t*\t*\t*\t\r\n\t\t\t*\t*\t\r\n\t\t\t\t*","questionVideo":"https://www.youtube.com/embed/Hf821tK1hIc","hints":[],"associated":[{"id":"ad78dd20-3725-4fba-9966-90f0eb3fa7b6","name":"In order to print a right aligned right angle triangle, what should be the value of st be in pattern 4","slug":"in-order-to-print-a-right-aligned-right-angle-triangle-what-should-be-the-value-of-st-be-in-pattern-4","type":4},{"id":"c3c516f4-39ba-4631-8400-fc31321ead59","name":"What will the initial value of st variable representing the stars be in pattern 4?","slug":"what-will-the-initial-value-of-st-variable-representing-the-stars-be-in-pattern-4","type":4},{"id":"cf6c2f26-acd4-4ee8-bf80-12c3b53b9799","name":"In order to print a right aligned right angle triangle, what should be the value of sp be in pattern 4?","slug":"in-order-to-print-a-right-aligned-right-angle-triangle-what-should-be-the-value-of-sp-be-in-pattern-4","type":4},{"id":"e009e1bb-d6a1-40f2-aae3-e3a262f0be59","name":"What will the initial value of sp variable representing the spaces be in pattern 4?","slug":"what-will-the-initial-value-of-sp-variable-representing-the-spaces-be-in-pattern-4","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"ca241a91-e685-4c63-9d83-892cf12c5576","name":"Patterns","slug":"patterns-9997","type":0},{"id":"86270318-8803-487a-b5e5-1d05a45d0113","name":"Pattern 4","slug":"pattern-4","type":1}],"next":{"id":"c9c7b8db-7248-4b7d-99a6-6bb96893a277","name":"Pattern 4","type":3,"slug":"pattern-4"},"prev":{"id":"6030edb3-42f0-470f-9bf6-3932b26b45c6","name":"Pattern 3","type":3,"slug":"pattern-3"}}}`

# Pattern 4

<p>1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format.</p>

`{"id":"f8e1424e-d4e2-4495-be3d-e16e237f7cff","name":"Pattern 4","description":"<p>1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format.</p>","inputFormat":"A number n","outputFormat":"<img src=\"http://pepcoding.com/resources/ojquestionresource/images/pat41.JPG\" alt=\"pat41\">","constraints":"1 &lt;= n &lt;= 100","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int n;\r\n cin >> n;\r\n\r\n //write your code here\r\n\r\n}"},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n\r\n // write ur code here\r\n\r\n }\r\n}"},"python":{"code":"n = int(input())\n#write your code here"}},"points":10,"difficulty":"easy","sampleInput":"5","sampleOutput":"*\t*\t*\t*\t*\t\r\n\t*\t*\t*\t*\t\r\n\t\t*\t*\t*\t\r\n\t\t\t*\t*\t\r\n\t\t\t\t*","questionVideo":"https://www.youtube.com/embed/Hf821tK1hIc","hints":[],"associated":[{"id":"ad78dd20-3725-4fba-9966-90f0eb3fa7b6","name":"In order to print a right aligned right angle triangle, what should be the value of st be in pattern 4","slug":"in-order-to-print-a-right-aligned-right-angle-triangle-what-should-be-the-value-of-st-be-in-pattern-4","type":4},{"id":"c3c516f4-39ba-4631-8400-fc31321ead59","name":"What will the initial value of st variable representing the stars be in pattern 4?","slug":"what-will-the-initial-value-of-st-variable-representing-the-stars-be-in-pattern-4","type":4},{"id":"cf6c2f26-acd4-4ee8-bf80-12c3b53b9799","name":"In order to print a right aligned right angle triangle, what should be the value of sp be in pattern 4?","slug":"in-order-to-print-a-right-aligned-right-angle-triangle-what-should-be-the-value-of-sp-be-in-pattern-4","type":4},{"id":"e009e1bb-d6a1-40f2-aae3-e3a262f0be59","name":"What will the initial value of sp variable representing the spaces be in pattern 4?","slug":"what-will-the-initial-value-of-sp-variable-representing-the-spaces-be-in-pattern-4","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"ca241a91-e685-4c63-9d83-892cf12c5576","name":"Patterns","slug":"patterns-9997","type":0},{"id":"86270318-8803-487a-b5e5-1d05a45d0113","name":"Pattern 4","slug":"pattern-4","type":1}],"next":{"id":"c9c7b8db-7248-4b7d-99a6-6bb96893a277","name":"Pattern 4","type":3,"slug":"pattern-4"},"prev":{"id":"6030edb3-42f0-470f-9bf6-3932b26b45c6","name":"Pattern 3","type":3,"slug":"pattern-3"}}}`

Editor

# Pattern 4

easy

1. You are given a number n. 2. You've to create a pattern of * and separated by tab as shown in output format.

1 <= n <= 100

A number n

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}5`

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}* * * * * * * * * * * * * * *```

Question Video

Discussions

Show Discussion

Related Resources