`{"id":"2a1e84da-51d8-44fa-b8e9-8ae7f68ccf52","name":"Pattern 9","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/pat91.JPG\" alt=\"pat91\">","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}"},"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/zcoVmVMIymQ","hints":[],"associated":[{"id":"16f235ec-67ec-4aa7-83c2-46cbd05cf5da","name":"Can we make the same pattern using while loop instead of for Loop (pattern 9)?","slug":"can-we-make-the-same-pattern-using-while-loop-instead-of-for-loop-pattern-9","type":4},{"id":"565af966-6c56-4daf-a36f-6b3e0a8c27cd","name":"What will be time complexity of the for Loop in the pattern 9?","slug":"what-will-be-time-complexity-of-the-for-loop-in-the-pattern-9","type":4},{"id":"c4cb51b4-9afa-4291-a861-df07d5b0e5e1","name":"Can we use one while loop and one for Loop to print this pattern 9?","slug":"can-we-use-one-while-loop-and-one-for-loop-to-print-this-pattern-9","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":"22be1f6b-6224-4443-aeb8-9425e81e996e","name":"Pattern 9","slug":"pattern-9","type":1}],"next":{"id":"056d8563-af67-4b12-b86d-8d871b9921d2","name":"Pattern 9","type":3,"slug":"pattern-9"},"prev":{"id":"2ef5b522-3d1d-4ac3-b78d-95ff71d1f389","name":"Pattern 8","type":3,"slug":"pattern-8"}}}`

Pattern 9

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":"2a1e84da-51d8-44fa-b8e9-8ae7f68ccf52","name":"Pattern 9","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/pat91.JPG\" alt=\"pat91\">","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}"},"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/zcoVmVMIymQ","hints":[],"associated":[{"id":"16f235ec-67ec-4aa7-83c2-46cbd05cf5da","name":"Can we make the same pattern using while loop instead of for Loop (pattern 9)?","slug":"can-we-make-the-same-pattern-using-while-loop-instead-of-for-loop-pattern-9","type":4},{"id":"565af966-6c56-4daf-a36f-6b3e0a8c27cd","name":"What will be time complexity of the for Loop in the pattern 9?","slug":"what-will-be-time-complexity-of-the-for-loop-in-the-pattern-9","type":4},{"id":"c4cb51b4-9afa-4291-a861-df07d5b0e5e1","name":"Can we use one while loop and one for Loop to print this pattern 9?","slug":"can-we-use-one-while-loop-and-one-for-loop-to-print-this-pattern-9","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":"22be1f6b-6224-4443-aeb8-9425e81e996e","name":"Pattern 9","slug":"pattern-9","type":1}],"next":{"id":"056d8563-af67-4b12-b86d-8d871b9921d2","name":"Pattern 9","type":3,"slug":"pattern-9"},"prev":{"id":"2ef5b522-3d1d-4ac3-b78d-95ff71d1f389","name":"Pattern 8","type":3,"slug":"pattern-8"}}}`

Editor

Pattern 9

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