0% found this document useful (0 votes)
19 views1 page

Computes Sience Psuedocode Practice

Uploaded by

dramganguda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Computes Sience Psuedocode Practice

Uploaded by

dramganguda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

WINTER BREAK

PSEUDOCODE PRACTICE EXERCISES


IB1 HL

1. Create a for loop that outputs numbers 10 to 1

2. Create a while loop that outputs all the even numbers between 1 to 20

3. Write a while loop that outputs all multiples of 5 between 5 and 50

4. Write a while loop that calculates the sum of all odd numbers between 1 and 20.

5. Write a while loop that outputs the first 10 numbers in the Fibonacci sequence:

0,1,1,2,3,5,8,13,21,34

6. Write a for loop (single loop) that outputs the multiplication table for the number

3 (e.g., 3 x 1 = 3, 3 x 2 = 6, ... up to 3 x 10).

7. Write a while loop that counts and outputs the number of digits in an integer.

8. Write a program that asks the user for two numbers, a and b. It calculates and
outputs the product of all integers between a and b (inclusive). Assume a is
always less than or equal to b.
9. Write a program that asks the user for a number and a specific digit (e.g., 5). The
program should count and output how many times the digit appears in the given
number.
10. Write a program that calculates the power of a number without using built-in
functions. Ask the user for the base (x) and the exponent (n), then compute and
output xnx^nxn using a loop. Assume the exponent n is a non-negative integer.

You might also like