{"id":"ad63f86b-e9aa-48e8-90d8-0f406a74b140","name":"Pattern 2","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/pat21.JPG\" alt=\"pat21\">","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\r\n*\t*\t*\t\r\n*\t*\t\r\n*","questionVideo":"https://www.youtube.com/embed/Y-AePs3E7FU","hints":[],"associated":[{"id":"214a406d-2378-43e8-9008-2fe27b5a3291","name":"Which of the folowing is the correct way of writing for loop in pattern 2?","slug":"which-of-the-folowing-is-the-correct-way-of-writing-for-loop-in-pattern-2","type":4},{"id":"8536427a-9446-46d9-8453-30a49a0d7648","name":"Which of the following is the correct way of writing import statement in pattern 2?","slug":"which-of-the-following-is-the-correct-way-of-writing-import-statement-in-pattern-2","type":4},{"id":"d3f723a2-8100-48b0-9ec6-eefccef4a1ba","name":"Which statement shifts the sentence into next line in pattern 2?","slug":"which-statement-shifts-the-sentence-into-next-line-in-pattern-2","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":"02a38fd1-44fd-4963-b93d-6b3d95818050","name":"Pattern 2","slug":"pattern-2","type":1}],"next":{"id":"712d1897-6749-4a5f-a4d1-b5eac8d33d0c","name":"PATTERN 2","type":3,"slug":"pattern-2"},"prev":{"id":"10431405-c060-4328-abb7-1c0a6724fede","name":"PATTERN 1","type":3,"slug":"pattern-1"}}}

Pattern 2

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":"ad63f86b-e9aa-48e8-90d8-0f406a74b140","name":"Pattern 2","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/pat21.JPG\" alt=\"pat21\">","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\r\n*\t*\t*\t\r\n*\t*\t\r\n*","questionVideo":"https://www.youtube.com/embed/Y-AePs3E7FU","hints":[],"associated":[{"id":"214a406d-2378-43e8-9008-2fe27b5a3291","name":"Which of the folowing is the correct way of writing for loop in pattern 2?","slug":"which-of-the-folowing-is-the-correct-way-of-writing-for-loop-in-pattern-2","type":4},{"id":"8536427a-9446-46d9-8453-30a49a0d7648","name":"Which of the following is the correct way of writing import statement in pattern 2?","slug":"which-of-the-following-is-the-correct-way-of-writing-import-statement-in-pattern-2","type":4},{"id":"d3f723a2-8100-48b0-9ec6-eefccef4a1ba","name":"Which statement shifts the sentence into next line in pattern 2?","slug":"which-statement-shifts-the-sentence-into-next-line-in-pattern-2","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":"02a38fd1-44fd-4963-b93d-6b3d95818050","name":"Pattern 2","slug":"pattern-2","type":1}],"next":{"id":"712d1897-6749-4a5f-a4d1-b5eac8d33d0c","name":"PATTERN 2","type":3,"slug":"pattern-2"},"prev":{"id":"10431405-c060-4328-abb7-1c0a6724fede","name":"PATTERN 1","type":3,"slug":"pattern-1"}}}
plane

Editor


Loading...

Pattern 2

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

Format

Input

A number n

Output

pat21

Example

Sample Input

5

Sample Output

* * * * * * * * * * * * * * *

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode