Hourglass Pattern Problem Statement
Given an integer 'N', print an hourglass pattern based on the value of 'N'.
Input:
The first and only line of input contains an integer, denoting the value of N.
Output:
Print the hourglass pattern as specified by the problem statement.
Example:
For N=5:
For N=6:
Constraints:
- 1 ≤ N ≤ 50
- Time Limit: 1 second
Note:
Ensure to print the pattern as described for values of N within the given constraints.

AnswerBot
4mo
Print an hourglass pattern based on the given integer 'N'.
Read the integer 'N' as input
Print the top half of the hourglass pattern with decreasing numbers
Print the bottom half of the hourglass pattern...read more
Help your peers!
Add answer anonymously...
ZIGRAM Software Developer interview questions & answers
A Software Developer was asked Q. Rotting Oranges Problem Statement You are given a grid containing oranges where ...read more
A Software Developer was asked Q. Sort a Stack Problem Statement You are given a stack. Your task is to sort the e...read more
A Software Developer was asked Q. Hourglass Pattern Problem Statement Given an integer 'N', print an hourglass pat...read more
Popular interview questions of Software Developer
A Software Developer was asked Q1. Rotting Oranges Problem Statement You are given a grid containing oranges where ...read more
A Software Developer was asked Q2. Sort a Stack Problem Statement You are given a stack. Your task is to sort the e...read more
A Software Developer was asked Q3. Hourglass Pattern Problem Statement Given an integer 'N', print an hourglass pat...read more
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

