Functions
Functions
Exercise 52
Write a function to calculate the price including VAT. This function will receive a Real parameter
named "prixHT" and a second Real parameter named "tva".
Exercise 53
Exercise 54
Exercise 55
Write a function to find out how many times a character occurs in a string. The character to be
searched for and the string will be passed as parameters .
Exercise 56
Exercise 57
Exercise 58
Write a function that calculates the PGCD of two strictly positive integers.
Exercise 59
Write a procedure that reads two numbers, calculates their sum and product and displays whether
they are positive or negative.
Exercise 60
Write a procedure that reads a list of integers (N numbers) whose last value = -1
and displays the number of even integers and their percentage of the given number of integers.
Exercise 61
Write a procedure to enter two values M and N and display all even values between M and N if M<N.
Exercise 62
Recursive functions
Exercise 63
Write a recursive function to calculate the factorial of an integer entered by the user.
Exercise 64
Write a recursive function to calculate the sum 1+2+3+...+ N. where N is entered by the user.
Exercise 65
Write a recursive function that, given a real number x and a positive integer value n, calculates x to
the nth power.
Exercise 66
Exercise 67
Write a recursive function to display the integers from A to B . Where A and B are parameters of this
function.
Exercise 68
Write a recursive function to calculate the PGCD of two integers passed as parameters,( using Euclid's
algorithm).