Lab 7 Questions.html -

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
<div role="alert" class="ic-flash-static ic-flash-error"> <h1>You need to have JavaScript enabled in order to access this site.</h1> </div> Skip To Content Dashboard Account Dashboard Courses Groups Calendar 2 Inbox Close Object 1 My Dashboard COMP101 Assignments Lab 7 Questions 2016-2017 Fall (Q1) Home Announcements Assignments Discussions Grades People Files Syllabus Quizzes
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Lab 7 Questions Due No Due Date Points 0 Question 1: Write a program that reads an integer (N), and prints all the perfect numbers smaller than smaller than N as integers. NOTE : A perfect number is defined as follows: Any positive number whose sum of its positive divisors except itself is equal to itself. (e.g., 6 and 28 are perfect numbers (6 = 1 + 2 + 3), (28 = 1 + 2 + 4 + 7 + 14): Input 7 500 1000 Output 6 6 28 496 6 28 496 Question 2: Write a program that reads an integer value (N), and computes the sum of the second powers of each digit as an integer.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern