Introduction to Algorithm and Programming (CSCT2105)
Computer Science - COS
Semester: First Semester
Level: 200
Year: 2019
1/1
FIRST SEMESTER EXAMINATION
SCHOOL: HTTTC DEPARTMENT: COMPUTER SCIENCE OPTION: ICT&FCS
COURSE CODE: CSCT2110 COURSE TITLE: Introduction to Algorithm Prog.
LECTURER: Mbiethieu Cezar CREDIT VALUE: 3
DATE: TIME: 1h30 START …..AM/PM END……AM/PM
Instructions: comment your codes
Exercise 1(20marks)
Given the following function and the ASCII code table, execute and give the output of the function knowing
that the function “write_char()” displays the character/letter corresponding to the ASCII code given as
parameter.
Exercise 2 (20marks) Write an algorithm to calculate the greatest common divisor of two positives
numbers A and B. Example GCD(4,4) = 4; GCD(6,5) = 1
Exercise 3 (30 marks)
Given an array of integers A of size MxN,
a- write a function to display the elements of A column by column; Example if
A=
then your program displays: a00, a10, a20; a01, a11, a21; a02; a12, a22;
b. Write a function that multiplies the elements of the last column of A by number X given as
function parameter.
REPUBLIC OF CAMEROON
Peace – Work – Fatherland
----------
REPUBLIQUE DU CAMEROUN
Paix – Travail -Patrie
-------
www.schoolfaqs.net