0% found this document useful (0 votes)
5 views2 pages

CIT 1203 - Structured Programming QP PRINT

Uploaded by

6pjwnvgjn2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

CIT 1203 - Structured Programming QP PRINT

Uploaded by

6pjwnvgjn2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

/

C
+
+

P
r DEDAN KIMATHI UNIVERSITY OF TECHNOLOGY
o UNIVERSITY EXAMINATIONS 2022/2023 ACADEMIC YEAR
g DEGREE OF BACHELOR OF SCIENCE IN BUSINESS INFORMATION TECHNOLOGY
r
a CIT 1203: STRUCTURED PROGRAMMING
m
DATE: 13/04/2023 TIME: 08.30-10.30 AM.
t
o Instructions: Answer Question 1 and Any Other Two

c
a QUESTION ONE (30 MARKS)
l a) Using a single C program, Explain the following terms
c (4Marks)
u i. Variable ii. Keyword iii. Comment iv. Operator
l b) With help of a C program, differentiate between Global and Local variables
a (4Marks)
t c) Write a C program to calculate sum of 5 subjects and find their percentage.
e (5 Marks)
d) Give the output of the program below and explain how it was arrived at
(4 Marks)
g
r #include<stdio.h>
a int main()
d {
e int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
o p=&a[2][2][2];
f *q=***a;
printf(“%d----%d”,*p,*q);
}
s
e) Discuss any THREE arithmetic operator used in c programming list them in order of
t precedence
u (3 Marks)
d f) With the help of a C program, explain the TWO ways to define constants
e (4 Marks)
n g) Outline the difference between a string copy (strcpy) and a memory copy (memcpy).
t (2 Marks)
h) You are tasked with explaining the way a Function is declared and defined in programming in a
# presentation to you classmates. Use a C program to show the difference between Function
i Declaration and Definition.
(4 Marks)
n
c
l
u
d
QUESTION TWO (15 MARKS)
a) Discuss the term array initialization using an example
(3 Marks)
b) Write a C Program that calculates the largest of two numbers in
a given Array. The program First should accepts an array, then
compares the elements and finds which is the largest two element
in a given array.
(8 Marks)

c) Outline four types of operators in C program giving an example for each type.
(4 Marks)
QUESTION THREE (15 MARKS)
a) Using a C program, explain the difference between passing a parameter by reference and by
value to a function.
(5 Marks)
b) Write a program to display all odd numbers between 100 down to 23 inclusive using a for loop.
(6 Marks)
c) C Language statements, labels, arrays e.t.c. are separated by special characters known as
delimiters. Enumerate the use of the following delimiters in C language construct.
(4 Marks)
i. #
ii. [ ]
iii. { }
iv. ;
QUESTION FOUR (15 MARKS)
a) Give the difference between ‘while loop’ and ‘do while loop’ with example.
(5 Marks)
b) The table below shows the Dekut graduation classification based on average marks over four
years. Use it to answer the questions that follow.
AVERAGE GRADE
70-100 First Class honours
60-69 Second Class honours-Upper Division
50-59 Second Class honours- Lower Division
40-49 Pass
0-39 Fail

Design a pseudo code that can be used to grade and print a student’s degree classification
following these criteria.
(5 Marks )
c) Write a C Program using switch statement to display the days from Monday to Sunday when
the user enters the first letter of any day of the week.
(5 Marks)

You might also like