Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

KAIMOSI FRIENDS UNIVERSITY (KAFU)

UNIVERSITY EXAMINATIONS
2022/2023 ACADEMIC YEAR

FIRST YEAR FIRST SEMESTER EXAMINATIONS


FOR THE DEGREE
OF
BACHELOR OF SCIENCE (COMPUTER SCIENCE) / EDUCATION SCIENCE

COURSE CODE: BCS 111

COURSE TITLE: INTRODUCTION TO PROGRAMMING

DATE: 16/10/2023 TIME: 2hrs

INSTRUCTIONS TO CANDIDATES

Answer ALL questions


QUESTION ONE [30 MARKS]
a) Differentiate between Machine Language, Assembly Language, and high-level languages.
( 6 marks)

b) Using relevant examples explain three operators used in C programming. (6 marks)

c) Write a C program that can be used to find the area of a triangle using the following formula:

(½x b x h). (6 marks)

d) Outline the rules of naming variables in programming. (4 marks)

e) Explain the structure of a basic C program. (3 marks)

f) Write a C program which accepts two integers, calculates their sum and displays the sum.
(5 marks)

You might also like