Beruflich Dokumente
Kultur Dokumente
Question ONE
c. Provide the syntax for a for loop. Outline four steps that describe the working of a for loop
[5 marks]
e. Write an algorithm that reads the two sides of a rectangle and calculate its area. [4 marks]
Question TWO
d) Write a C program that prompts the user for his name and prints it. [4 marks]
Question THREE
b. State three differences between Variable Declaration and variable Definition. [6 marks]
c. Write a C program that uses a function n to calculate area of a circle. The user enters the radius.
[10 marks]
Question FOUR
b. Write a program that stores a sentence entered by a user into a data file [10 marks]
Question FIVE
a. Outline three types of program errors sating potential cause for each. [6 marks]
b. A recursive function is a function that calls itself. Provide the syntax of a recursive function
[4 marks]
c. Write a C program that stores elements in a 2x2 array and prints the output. [6 marks]