Given the total number of rows as n, the task is to print the given pattern.
Input: n = 5 Output: * 1* *2* 1*3* *2*4* Input: n = 10 Output: * 1* *2* 1*3* *2*4* 1*3*5* *2*4*6* 1*3*5*7* *2*4*6*8* 1*3*5*7*9*
Below is the solution to the above problem:
* 1* *2* 1*3* *2*4*
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to print pyramid pattern
- Program to print hollow pyramid and diamond pattern
- C Program to print pyramid pattern
- Program to print a inverse pyramid character pattern
- Program to Print Pyramid Pattern using numbers
- Print the pyramid pattern with given height and minimum number of stars
- Print the following pyramid pattern
- Smallest odd number with even sum of digits from the given number N
- Number formed by deleting digits such that sum of the digits becomes even and the number odd
- Programs for printing pyramid patterns in Python
- Programs for printing pyramid patterns in Java
- PHP programs for printing pyramid patterns
- Programs for printing pyramid patterns using recursion
- Programs for printing pyramid patterns in C++
- Check whether a given number is even or odd
- Check whether given floating point number is even or odd
- Smallest number possible by swapping adjacent even odd pairs
- Java program to print Even length words in a String
- Distinct strings with odd and even changes allowed
- Check if a given string is Even-Odd Palindrome or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.