spc 2101 introduction to computer programming concepts Year I Semester II
spc 2101 introduction to computer programming concepts Year I Semester II
Question Two
a) Write a C program to calculate product of two numbers. (5 Marks)
b) Distinguish between a while loop and do…while loop. (2 Marks)
c) Using examples, demonstrate how logical operators can be applied during
programming. (6 Marks)
d) Write a C program to convert degrees centigrade to Fahrenheit. Given the formula:
F=(Celsius*5/9) +32. (7 Marks)
Page 1 of 2
Question Three
a) Write a C program to calculate simple interest. Given: I=
Principle*Rate*Time/100 (7 Marks)
b) Draw a program flowchart to compare three numbers and display the largest.
(7 Marks)
c) Describe the stages of program development. (6 Marks)
Question Four
a) Write a C program to find the area and circumference of a circle for radius
greater or equal to 10. The program should be implemented using while structure.
(7 Marks)
b) Explain two advantages of using a high level language to develop programs.
(4 Marks)
c) Write a C program to calculate gross pay, given that allowances are 15% of the
basic pay. Hint Grosspay=basic+allowances. (7 Marks)
d) Describe the term Pseudocode as used in programming. (2 Marks)
Question Five
a) Write a C program to compare three integers and display the largest. The
program should be implemented using If structure. (7 Marks)
b) Describe four characteristics of a good program. (4 Marks)
c) Write a C program to calculate factorial of number N. (7 Marks)
d) State two examples of syntax errors in C programming. (2 Marks)
Page 2 of 2