19. SMA 2175 COMPUTER PROGRAMMING 1 EXAM (PAPER II)(1)
19. SMA 2175 COMPUTER PROGRAMMING 1 EXAM (PAPER II)(1)
Page 1 of 2
Float area;
C = PI
R = 10;
Perimeter = 2.0*C*R;
Area = C*R*R;
Printf(“%f” “%d”, &perimeter, &area)
} {10 marks}
(b) Describe the format of a C program {10 marks}
(c) Using a program example explain the difference between While and Do-While loop statements {5 marks}
Question five (20 marks)
(a) State three advantages of using functions in a program {3 marks}
(b) Using functions write a program to perform multiplication and division of two variables. {6 marks}
(c) Explain how to initialize a one dimensional array and a two dimensional array {4 marks}
(d) Write a pseudo code and draw a flowchart for a program to find even numbers between 1 to 100 {7 marks}
Page 2 of 2