In order to help me with this, please check my previousquestion parts first then
ID: 3610097 • Letter: I
Question
In order to help me with this, please check my previousquestion parts first then you will able to understand how to dothis.An integer is said to be a perfect number if all its factors,including 1 (but not the number itself), sum to that number. For example, 6 is a perfect number because 1, 2, and 3 are all thefactors of 6 (ignoring the number itself) and 1 + 2 + 3 = 6.
(d) Use a "twirly" to indicate that your program is happily workingaway. A "twirly" is the following characters printed over thetop of each other in the following order: '|''/' '-' ''. This has the effect of producing aspinning wheel - ie a "twirly". Hint: to do this you can use (instead of ) in printf to givea carriage return only (instead of a carriage returnlinefeed). (Note: this may not work on some systems - you donot have to do it this way.)
Explanation / Answer
please rate - thanks I left it out in the special code for 1 before it was twirlying a different time depending on the value ofn. I changed it to be the same time, no matter what the valueof n. Please check your facts, everything I saw said there are no knowodd perfect numbers, 1 is odd. all lists of perfect numbersstart with 6. Are you sure 1 is a perfect number. #include #include using namespace std; void twirly(int n); int perfect(int num){ if(num==1) //bydefinition { printf("1 is a perfectnumber "); twirly(num); return 1; } int sum=0; printf("Factors of %d num are: ",num); for(int i=1; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.