Write a C++ (or any programming) program/function to output the sequence of a person's ancestors that take an integer of
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a C++ (or any programming) program/function to output the sequence of a person's ancestors that take an integer of
Write a C++ (or any programming) program/function to output the sequence of a person's ancestors that take an integer of the number of generations as a parameter and returns the number of ancestors. Sequences Imagine that a person decides to count his ancestors. He has two parents, four grandparents, eight great- grandparents, and so forth. These numbers can be written in a row as 2, 4, 8, 16, 32, 64, 128, ... To express the pattern of the numbers, suppose that each is labeled by an integer giving its position in the row. Position in the row 1 2 4 5 6 7... 3 Number of ancestors 2 4 8 16 32 64 128... Please attach a screenshot of the output. See also Modules-EppDM5e_05_01.pdf, slides 2-5.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!