The Tutorial Serie - 1
The Tutorial Serie - 1
Module ALGO1
1 2 --- 20
21 22 --- 40
Write an algorithm that takes an integer between 1 and 200 as input and then displays in
which row and column the student should place themselves.
For example, if n = 35, the student must place themselves in the 2nd row and the 15th
column.
Exercice 4 :
Calculate then show the sum of the first N powers of a number K such that 2 ≤ K ≤10.
Example: if the entered value of N is 5 and the number K is equal to 2 then the result is 63
(= 1+2+4+8+16+32)
Exercice 5 :
Write an algorithm to solve each of the following problems:
1- Display of the number of uppercase letters and the number of lowercase letters from a
sequence of characters ending with the character '#'.
2- Search for the minimum and maximum in a set of N real numbers.
3- comput of the quotient and remainder of the division of two integers A and B without using
the division operation.
4- Checking if a positive integer X is prime or not.
5- Display of the complete alphabet ('A' to 'Z') or ('a' to 'z').
6- Calculate the number of occurrences of a digit C (0 ≤ C < 10) in a positive integer A.
Exercice 6 :
Write an algorithm to display the Mirror of a positive integer A.
Example: Mirror of 26538 = 83562
Exercice 7 :
Write the algorithm for determining the GCD of two integers A and B using the following
methods:
Method 1: successive subtractions. Method 2: Euclidean division.
Exercice 8 :
Write the algorithm to determine the LCM of two integers A and B (without using the GCD).
Exercice 9 :
Write an algorithm that determines and displays the Nth value of the sequence (UN), when
U = 0 ; U = 1 ; U = 2 ; U = 2U + 3U for N > 2.
0 1 2 N N-1 N-3