Midterm Exam in Qbasic
Midterm Exam in Qbasic
Faculty of Engineering
Shebin El-Kom
Midterm Exam
Academic Year: 2013-2014
Name:
Group A
PRINT a
Ans.:
e. a$ = "1546"
b$ = "4"
MID$(a$, 2, 1) = b$
a$ = STR$(5) + a$
a = VAL(a$) + LEN(a$)
2. Suppose you have the flowing set of numbers
(5, 112, 20, -3, 70, 40, 15, 50, 111, 80, 22, 13)
Write a computer program the counts the odd and even numbers then the program sorts the odd number in
ascending order and the even number in descending order. The output should be the original number set and
the odd and even number in the required order