Get premium membership and access revision papers, questions with answers as well as video lessons.

Comp 111: Introduction To Computer Programming April 2011 Question Paper

Comp 111: Introduction To Computer Programming April 2011 

Course:2011

Institution: Kabarak University question papers

Exam Year:2011



COURSE CODE: COMP 111
COURSE TITLE: INTRODUCTION TO PROGRAMMING
STREAM: SESSION III & IV

INSTRUCTIONS:
1. This paper has two parts: section ‘A’ and section ‘B’.
2. Section ‘A’ has ONE question which is COMPULSORY and carries 30 marks.
3. attempt ANY TWO questions section B

SECTION A
QUESTION ONE (30 MARKS)
a) Discuss the steps that are followed when executing a C program. (5marks)
b) The basic structure of C program comprises of the different elements. Discuss these
elements. (5marks)
i. Preprocessor statements
ii. Main()
iii. A pair of curl brace { }
iv. Declaration and statements
v. User defined functions

c) Explain any five characteristics of a C program. (5marks)
d) What are the rules for constructing variable names? (4marks)
e) What is a computer system? (2marks)
f) What is the main difference between Hardware and Software in computer system?
(2marks)
g) Write a simple C program to calculate the average of two numbers. (5marks)
h) What are pointers? (2marks)


SECTION B
QUESTION TWO (20MARKS)
a) Discuss the If…….Else statement. Give the syntax. (5marks)
b) Explain the aim of the code below and give the output it will produce. What will make
this code not to execute. (5marks)
void main(void) {
for ( int i=0; I <=10; ++i)
{
Printf(“ %d\t”,i);
} }
c) What are the functions of the following statements?
i. Goto statement. (2marks)
ii. Continue statement. (2marks)
iii. Break statement. (2marks)
d) Discuss call by reference and call by value. (4marks)

QUESTION THREE (20MARKS)
a) Write some note on the following.
i. Local variables. (2marks)
ii. Global variables. (2marks)
iii. Static variables. (2marks)
b) State three categories under which functions can be categories. (3marks)
c) What is an array? (2marks)
d) Loop statements are important in any program when one wants to repeat statements again
and again. How does this loop function?
for (initialization; condition; increase) statement; (5marks)
e) Discuss escape sequence characters and the function of any three escape characters.
(4marks)

QUESTION FOUR (20MARKS)
a) Functions are sometimes called procedures and every program contains at least one
function. What are the advantages of functions and what is its syntax?
(5marks)
b) Outline the components of a computer system. (5marks)
c) Explain the programming languages. (5marks)
d) Differentiate compilers and interpreters. (4marks)
e) What is a program? (1mark)






More Question Papers


Popular Exams



Return to Question Papers