Presentation is loading. Please wait.

Presentation is loading. Please wait.

L AB 4 July 5th. F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes.

Similar presentations


Presentation on theme: "L AB 4 July 5th. F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes."— Presentation transcript:

1 L AB 4 July 5th

2 F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes

3 F OR LOOP

4

5 C ONVERT THE F OR LOOP TO W HILE LOOP Exercise 2:

6 C ONVERT THE F OR LOOP TO W HILE LOOP

7 F OR LOOP Exercise 3: Duplicate each element in an array Input: Array [1,2,3,4] Output: Array [1,1,2,2,3,3,4,4]

8

9 C HALLENGE Q UESTION : N ESTED L OOPS Exercise 4 Printing Out rows of Stars Ask the user for how many rows

10 C HALLENGE Q UESTION : N ESTED L OOPS


Download ppt "L AB 4 July 5th. F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes."

Similar presentations


Ads by Google