You are on page 1of 1

MOCK EXAM – No.

3
(Duration: 60 minutes)
Module: Elementary Programming with C (Total: 20 marks)

Question 1 (5 marks):
Write one program implemented the following:
- Print out screen:
**********************************************************
* Full name: (Your full name) *
* Selected 1: Solve the quadratic equation 1 *
* Selected 2: Exit program *
**********************************************************
- Allows users to enter one character:
+ Enter number 1: Solve the quadratic equation 1
+ Enter number 2: Exit program

Question 2 (5 marks):
Write one program implemented the following:
- Input 1 array with n elements integers.
- Print out screen average value of the array.

Question 3 (5 marks):
Write one program implemented the following:
- Enter the array of age of the students in class
- Sort and print the list to the screen in the order of ascending of the age

Question 4 (5 marks):
- Create one file with name include your name and class and write the following
in the file:
Xin chao!
Toi ten la: Ten cua ban.
Toi dang hoc lap trinh tai Softech.
Example: Your name: Nguyen Van Anh and class: batch 146. File name is:
vananh146.txt
- Open the file you just created above and print out the screen contents of a file

You might also like