Question: Programming language is C++ PA 12-1 (25 points) A pentagonal number is defined as n(3n-1)/2 for integers1. The first numbers are 1, 5, 12, 22,

Programming language is C++

Programming language is C++ PA 12-1 (25 points) A pentagonal number is

PA 12-1 (25 points) A pentagonal number is defined as n(3n-1)/2 for integers1. The first numbers are 1, 5, 12, 22, Write a function with the following header getPentagonalNumber (int n) that returns one pentagonal number. In main() call the function to display the first 20 pentagonal numbers D:CodeBlocks-EP1CodeBlocks-EP 1 12 35 51 70 92 145 176 210 247 287 330 376 425 477 532 590

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!