Question: C PROGRAM. When the user inputs a iteration, the program produces a pentagon shape using dots. THE PENTAGON Using C-language, have the variable num which

 C PROGRAM. When the user inputs a iteration, the program produces

C PROGRAM. When the user inputs a iteration, the program produces a pentagon shape using dots.

THE PENTAGON Using C-language, have the variable num which will be a positive integer and determine how many dots exist in a pentagonal shape around a center dot on the Nth iteration. For example, in the image below you can see that on the first iteration there is only a single dot, on the second iteration there are 6 dots on the third there are 16 dots, and on the fourth there are 31 dots Your program should return the number of dots that exist in the whole pentagon on the Nth iteration Sample Test Cases: Input:2 Output:6 ader

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!