Computes Sience Psuedocode Practice
Computes Sience Psuedocode Practice
2. Create a while loop that outputs all the even numbers between 1 to 20
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
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.