A few simple procedural questions

Source: Internet
Author: User

(a) The number of primes within 100

(ii) factorial seeking 1!+2!+3!+...+10!

(c) The total number of primes within 100

(iv) Calculate 1+1/2!+1/3!+ with Do-while and for loop ... The first 20 items and

(v) to ask for all the numbers within 100

Note: If a number is exactly equal to the sum of its factors, this number becomes the end number. The factor is all the numbers that divide this number, excluding the number itself, such as the factor of 15 1,3,5.

Sum=0 cannot be placed outside the for loop, because each time a n,sum value must be zeroed, it is placed on the outside.

A sum value generated by n can have an effect on n+1.

(vi) Use for loop to calculate 8+88+888+ ... The sum of the first 10 items

(vii) The output satisfies the maximum positive integer n of the 1+2+3+...+n<8888

A few simple procedural questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.