You are on page 1of 6

1)Write a program to get below pattern

Sample Input:- n=5

Sample Output:-

* * * * *
* * * *
* * *
* *
*
1) The pattern starts with 1 and displays up to N. The first and last row contains only 1 and the
remaining rows contains exactly 2 same numbers. From 1st to Nth row the size of pattern increases
and from 6th to 9th row the size of pattern decreased.

Input: 5

Output:

1
22
3 3
4 4
5 5
4 4
3 3
22
1
2) In the given below pattern, each row starts and ends with a star symbol, and the first and last rows contain only a star
symbol whereas the remaining columns contain the alphabet.

In this pattern, when row number and column number are first and last then there are stars only. Otherwise, there are alphabets
from ‘A’ to ‘Z’. When the alphabet is reached at ‘Z’ then it again started from ‘A’.
3) Write a program to get below pattern
4) Write a Program to delete an element from an array.
Sample Input:
5
12345
3

Sample Output:
Please enter number of elements
Enter the elements one by one
Input array elements:
1
2
3
4
5
Enter the element to be deleted
Array elements (list) after deleting 3:
1
2
4
5
6)

You might also like