Given a number n then print number in Digital form.
Input : 5 Output : - - | - - | - - Input : 8 Output : - - | | - - | | - -
Take a matrix of size 5*5 and store 0 and 1 in the matrix. If matrix cell is 0 then it is used for space and if matrix cell is 1 then it is used either for horizontal or vertical line.
If row number is even then print the horizontal (-) line and if row number is odd then print the vertical ( | ) line.
- - | | - - | - -
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 Matrix in Z form
- Print K'th element in spiral form of matrix
- Print matrix in antispiral form
- Print a given matrix in reverse spiral form
- Print a given matrix in zigzag form
- Print a matrix in a spiral form starting from a point
- Print a matrix in Reverse Wave Form
- Print a given matrix in counter-clock wise spiral form
- Print elements that can be added to form a given sum
- Print a given matrix in spiral form using direction tracking method
- Print matrix elements diagonally in spiral form
- Print a given matrix in spiral form
- Program to print a pattern of numbers
- Program to print numbers columns wise
- Program to print numbers with diamond pattern
- Program to print all the numbers divisible by 3 and 5 for a given number
- Python program to print all negative numbers in a range
- Python program to print all even numbers in a range
- Python program to print all odd numbers in a range
- Python program to print odd numbers in a List
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.
Improved By : Mithun Kumar