`{"id":"7122e10c-0da6-417b-93e9-f70bcae6b8e5","name":"Pattern 5","description":"1. You are given a number n.\r\n2. You've to create a pattern of * and separated by tab as shown in output format.","inputFormat":"A number n","outputFormat":"<img src=\"http://pepcoding.com/resources/ojquestionresource/images/pat51.JPG\" alt=\"pat51\">","constraints":"1 &lt;= n &lt;= 100\r\n Also, n is odd.","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 }\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\r\n\t*\t*\t*\t\r\n*\t*\t*\t*\t*\t\r\n\t*\t*\t*\t\r\n\t\t*\t","questionVideo":"https://www.youtube.com/embed/uKND5Sc2QzQ","hints":[],"associated":[{"id":"0bf2a609-051a-442f-8993-b609015e0dba","name":"Will this pattern be printed as desired for even input in pattern 5?","slug":"will-this-pattern-be-printed-as-desired-for-even-input-in-pattern-5","type":4},{"id":"39e304e4-914a-4626-bdb2-7352c82e4dbe","name":"What is the relation between number of spaces (sp) in first line and input n in pattern 5","slug":"what-is-the-relation-between-number-of-spaces-sp-in-first-line-and-input-n-in-pattern-5","type":4},{"id":"40e8264d-476f-402b-aade-f256ab796e89","name":"What is the correct order for printing in each line in pattern 5?","slug":"what-is-the-correct-order-for-printing-in-each-line-in-pattern-5","type":4},{"id":"81eca1cd-cd5d-4298-b8c4-db3adabaf654","name":"Stars are incrementing upto what values of row in pattern 5?","slug":"stars-are-incrementing-upto-what-values-of-row-in-pattern-5","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":"6e44dbca-2246-46f5-9f08-8f221de9143b","name":"Pattern 5","slug":"pattern-5","type":1}],"next":{"id":"28a9f1a8-6bc2-4137-a13c-8a1550f0b59a","name":"Pattern 5","type":3,"slug":"pattern-5"},"prev":{"id":"c9c7b8db-7248-4b7d-99a6-6bb96893a277","name":"Pattern 4","type":3,"slug":"pattern-4"}}}`

# Pattern 5

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

`{"id":"7122e10c-0da6-417b-93e9-f70bcae6b8e5","name":"Pattern 5","description":"1. You are given a number n.\r\n2. You've to create a pattern of * and separated by tab as shown in output format.","inputFormat":"A number n","outputFormat":"<img src=\"http://pepcoding.com/resources/ojquestionresource/images/pat51.JPG\" alt=\"pat51\">","constraints":"1 &lt;= n &lt;= 100\r\n Also, n is odd.","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 }\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\r\n\t*\t*\t*\t\r\n*\t*\t*\t*\t*\t\r\n\t*\t*\t*\t\r\n\t\t*\t","questionVideo":"https://www.youtube.com/embed/uKND5Sc2QzQ","hints":[],"associated":[{"id":"0bf2a609-051a-442f-8993-b609015e0dba","name":"Will this pattern be printed as desired for even input in pattern 5?","slug":"will-this-pattern-be-printed-as-desired-for-even-input-in-pattern-5","type":4},{"id":"39e304e4-914a-4626-bdb2-7352c82e4dbe","name":"What is the relation between number of spaces (sp) in first line and input n in pattern 5","slug":"what-is-the-relation-between-number-of-spaces-sp-in-first-line-and-input-n-in-pattern-5","type":4},{"id":"40e8264d-476f-402b-aade-f256ab796e89","name":"What is the correct order for printing in each line in pattern 5?","slug":"what-is-the-correct-order-for-printing-in-each-line-in-pattern-5","type":4},{"id":"81eca1cd-cd5d-4298-b8c4-db3adabaf654","name":"Stars are incrementing upto what values of row in pattern 5?","slug":"stars-are-incrementing-upto-what-values-of-row-in-pattern-5","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":"6e44dbca-2246-46f5-9f08-8f221de9143b","name":"Pattern 5","slug":"pattern-5","type":1}],"next":{"id":"28a9f1a8-6bc2-4137-a13c-8a1550f0b59a","name":"Pattern 5","type":3,"slug":"pattern-5"},"prev":{"id":"c9c7b8db-7248-4b7d-99a6-6bb96893a277","name":"Pattern 4","type":3,"slug":"pattern-4"}}}`

Editor

# Pattern 5

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.

## Constraints

1 <= n <= 100 Also, n is odd.

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