Skip to content

Tag Archives: pattern-printing

Given a 2D array, print it in reverse spiral form. We have already discussed Print a given matrix in spiral form. This article discusses how… Read More
Print simple patterns like below using single line of code under loop. Examples: Input : 5 Output : * ** *** **** ***** Input :… Read More
After a lot of programming algorithms, it’s turn to wish a programmer friend. Send this code to your coder friend and give him/her a surprise… Read More
Given a number n, write a program to print a diamond shape with 2n rows. Examples : Recommended: Please try your approach on {IDE} first,… Read More
Program to print following pattern:  Examples :  Input : 5 Output: * * * * * * * * * * * * * *… Read More
How to print below heart pattern in C? AAAAAAA AAAAAA AAAAAAAAA AAAAAAAA AAAAAAAAAAA AAAAAAAAAA AAAAAAAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBB… Read More
This article is aimed at giving a Java implementation for pattern printing.  Simple pyramid pattern Java import java.io.*;   // Java code to demonstrate star… Read More
This article is aimed at giving a C++ implementation for pattern printing.  Simple pyramid pattern   CPP // C++ code to demonstrate star pattern #include… Read More
Recently i was interviewed at Adobe(off-campus) Software-Engineer position and got placed. I would like to thank the whole GeeksforGeeks team for providing such a great… Read More
Given a matrix of n*n size, the task is to print its elements in a diagonal pattern.     Input : mat[3][3] = {{1, 2, 3},… Read More
  Patterns can be printed in python using simple for loops. First outer loop is used to handle number of rows and Inner nested loop… Read More
The idea of pattern based programs is to understand the concept of nesting of for loops and how and where to place the alphabets /… Read More
Given a obfuscated code that generates the map of India, explain its working. The following code when executed generates the map of India – #include… Read More
Given a number n, print a n x n spiral matrix (of numbers from 1 to n x n) in clockwise direction using O(1) space.… Read More
Write to program to print the pyramid pattern formed of stars Example : Input: n = 6 Output: * * * * * * *… Read More