Challenge for all programmers.
Language: Python.
Display the given pattern.
1
11
101
1001
10001
Restrictions:
• Don't use any conditional constructs.
Answers
Answered by
3
Answer:
Program to print modified Binary triangle pattern
Given an integer N, the task is to print the modified binary tree pattern.
In Modified Binary Triangle Pattern, the first and last element of a Nth row are 1 and the middle (N – 2) elements are 0.
Examples:
Input: N = 6
Output:
1
11
101
1001
10001
100001
Input: N = 3
Output:
1
11
101
Answered by
6
Attachments:
Similar questions