C++ please

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

C++ please

Post by answerhappygod »

C++ please
C Please 1
C Please 1 (134.73 KiB) Viewed 38 times
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 3 4 5 6 7... Number of ancestors 2 4 8 16 32 64 128... Please attach a screenshot of the output.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply