This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can someone help me with those problems?
01-18-2014, 01:34 AM
Post: #1
can someone help me with those problems?
1. Write a while loop that prints

A. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.

B. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90

C. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.

2. Write a loop that computes

A. The sum of all even numbers between 2 and 100(inclusive).

B. The sum of all squares between 1 and 100 (inclusive).

C. The sum of all odd numbers between a and b(inclusive).

D. The sum of all odd digits of n. (For example, if n is 32677, the sum would be 3 + 7 + 7 = 17)

Ads

Find all posts by this user
Quote this message in a reply
01-18-2014, 01:42 AM
Post: #2
 
Pretty simple stuff. What computer language?

Why is it that you don't know how to write this and are trying to cheat and have someone else do your work? You're only cheating yourself because if you need to know this stuff for the next course, you won't know how to do it.

Ads

Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)