{"id":"609d92af-a424-441f-a6d6-bc921ca3a9e4","name":"Pattern 3","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/pat31.JPG\" alt=\"pat31\">","constraints":"1 &lt;= n &lt;= 10","sampleCode":{"cpp":{"code":"#include <iostream>\nusing namespace std;\n\nint main(int argc, char **argv){\n int n;\n cin >> n;\n \n //write your code here\n \n}"},"java":{"code":"import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n\n // write ur code here\n\n }\n}"},"python":{"code":"n = int(input())\n\n#write your code here"}},"points":10,"difficulty":"easy","sampleInput":"5","sampleOutput":"\t\t\t\t*\r\n\t\t\t*\t*\r\n\t\t*\t*\t*\r\n\t*\t*\t*\t*\r\n*\t*\t*\t*\t*","questionVideo":"https://www.youtube.com/embed/ArnoqgUbN8I","hints":[],"associated":[{"id":"2b93eed1-5a2a-4b8c-8f28-7224f29a225a","name":"What is the correct order of printing this pattern 3?","slug":"what-is-the-correct-order-of-printing-this-pattern-3","type":4},{"id":"c4f6288c-3233-419d-9006-441039ff4532","name":"What will be my number of spaces in the last row in pattern 3","slug":"what-will-be-my-number-of-spaces-in-the-last-row-in-pattern-3","type":4},{"id":"d334a50c-c759-4887-8102-6bd66053df02","name":"How many stars will be printed in the n-1th row according to the pattern 3","slug":"how-many-stars-will-be-printed-in-the-n-1th-row-according-to-the-pattern-3","type":4},{"id":"dba2a562-239d-43e3-9e4d-0d5fdc4148c0","name":"How will my stars and spaces change as we go through the rows in pattern 3?","slug":"how-will-my-stars-and-spaces-change-as-we-go-through-the-rows-in-pattern-3","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":"075219c5-e51c-4992-bbfc-15f231083b30","name":"Pattern 3","slug":"pattern-3","type":1}],"next":{"id":"6030edb3-42f0-470f-9bf6-3932b26b45c6","name":"Pattern 3","type":3,"slug":"pattern-3"},"prev":{"id":"712d1897-6749-4a5f-a4d1-b5eac8d33d0c","name":"PATTERN 2","type":3,"slug":"pattern-2"}}}

Pattern 3

<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":"609d92af-a424-441f-a6d6-bc921ca3a9e4","name":"Pattern 3","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/pat31.JPG\" alt=\"pat31\">","constraints":"1 &lt;= n &lt;= 10","sampleCode":{"cpp":{"code":"#include <iostream>\nusing namespace std;\n\nint main(int argc, char **argv){\n int n;\n cin >> n;\n \n //write your code here\n \n}"},"java":{"code":"import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\n\n // write ur code here\n\n }\n}"},"python":{"code":"n = int(input())\n\n#write your code here"}},"points":10,"difficulty":"easy","sampleInput":"5","sampleOutput":"\t\t\t\t*\r\n\t\t\t*\t*\r\n\t\t*\t*\t*\r\n\t*\t*\t*\t*\r\n*\t*\t*\t*\t*","questionVideo":"https://www.youtube.com/embed/ArnoqgUbN8I","hints":[],"associated":[{"id":"2b93eed1-5a2a-4b8c-8f28-7224f29a225a","name":"What is the correct order of printing this pattern 3?","slug":"what-is-the-correct-order-of-printing-this-pattern-3","type":4},{"id":"c4f6288c-3233-419d-9006-441039ff4532","name":"What will be my number of spaces in the last row in pattern 3","slug":"what-will-be-my-number-of-spaces-in-the-last-row-in-pattern-3","type":4},{"id":"d334a50c-c759-4887-8102-6bd66053df02","name":"How many stars will be printed in the n-1th row according to the pattern 3","slug":"how-many-stars-will-be-printed-in-the-n-1th-row-according-to-the-pattern-3","type":4},{"id":"dba2a562-239d-43e3-9e4d-0d5fdc4148c0","name":"How will my stars and spaces change as we go through the rows in pattern 3?","slug":"how-will-my-stars-and-spaces-change-as-we-go-through-the-rows-in-pattern-3","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":"075219c5-e51c-4992-bbfc-15f231083b30","name":"Pattern 3","slug":"pattern-3","type":1}],"next":{"id":"6030edb3-42f0-470f-9bf6-3932b26b45c6","name":"Pattern 3","type":3,"slug":"pattern-3"},"prev":{"id":"712d1897-6749-4a5f-a4d1-b5eac8d33d0c","name":"PATTERN 2","type":3,"slug":"pattern-2"}}}
plane

Editor


Loading...

Pattern 3

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 <= 10

Format

Input

A number n

Output

pat31

Example

Sample Input

5

Sample Output

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

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode