<=Back

<=KNEC Craft Certificate in ICT module 2 structured programming past paper: November 2021

Outline three advantages of using a call by reference method as used in a C programming language.

    Viewed:  510  times

  Share in:
        

Question Answer:





Questions List:

1. Outline three types of C tokens in a C program
2. Outline the use of each of the following operators in a C program i) relational ii)Logical
3. State three differences between a character and a string constant as used in a C program
4. Outline three disadvantages of a low level programming language
5. Joan used linked list data structures in her program. Outline four advantages she is likely to realize from using this data structures
6. Explain one reason that would make a programmer use each of the following escape sequence operators in C program. i)\n ii)\r
7. The surface area of a cuboid is obtained by using the formula 2(width x length + length x height + height x width). Write a c program that would declare the dimensions and compute the surface area of the cuboid and display on the screen given that the length=10, width =20 and height=40.
8. Johnson intends to name identifiers when writing a C program. Outline three rules that he should observe
9. Explain two ways of defining constants in a C program
10. Distinguish between a pointer and an iterator as used in C programming
11. Outline three advantages of using a call by reference method as used in a C programming language.
12. John a programming student opted to use an objected oriented programming language to write a program. Outline three features of this language that he is likely to use
13. Explain the term sorting as used in C programming data structures
14. State four examples of sorting techniques used in data structures
15. Figure 1 shows a binary tree having the nodes A, B, C, D and E. Use it to answer the questions that follow Using the figure, state two characteristics of the binary tree.
16. Differentiate between an assembler and a compiler as used in programming
17. Explain three disadvantages of not following a program development life cycle during the development of software.
18. State the format specifics used with a printf statement to display each of the following: i)a value of an integer ii)a string variable iii)a hexadecimal value.
19. Distinguish between top down and bottom up program design approach as used in programming.
20. State one reason for performing each of the following program testing when developing a program: i)Security ii)Functional
21. Anne would like to include pointers in a program she is writing. Outline four advantages of using pointers.
22. The following is a syntax of a structure statement in a C program. Use it to answer the question that follows: Student. firstname State the function of the dot(.) operator in the statement.
23. Explain the function of each of the following declared function prototype statements in a C program: i) float area(int,int) ii) int sum(int).
24. A student used expressions in a C program that he developed. Outline three types of expressions that he may have used.
25. Write a C program that would prompt for 5 numbers one after the other and print the sum of the numbers using an array
26. Outline three advantages of structures in a C program.
27. Jane documented a program she developed using a C programming language. Describe three types of documentations she may have included
28. Write a C program that would display the following pattern when executed. Use a for loop statement. 1 1 2 2 3 3 4 4
29. Distinguish between printf() and putchar() function as used in C programming language
30. Explain the function of each of the following commands in a C program: i) curly braces; ii)return 0 iii)#include<stdio.h>
31. Write a C program that accepts a string of 10 characters and prints the first and last character of the string.