Professional Documents
Culture Documents
Q - Tutorial 1
Q - Tutorial 1
Section A: Student self-learning, reading and preparation before coming to the tutorial class
Remark: All the file must be saved in filename.c (.c extension) instead of .cpp extension
because this subject is using c instead of c++.
Section B: Practice the following tutorial questions during the lab session.
1. Use Dev-C++ to write a simple ANSI-C program to display a line of text on your
monitor screen. The source code is as follows:
a) printf(“Hello ”);
printf(“World”);
b) printf(“Hello\nWorld”);
c) printf(“Hello\tWorld\n\n\n”);
d) printf(“There is no class tomorrow! \n”);
1
2. Write a C program that will display as following output:
A B C D
- - - -
E 1 2 3 4
F 5 6 7 8
G 9 A B C
3. Assign the suitable Identifiers for the following items below: (E.g.: “COMPUTER” is a constant
string)
a) ‘c’
b) average
c) 12.5
d) 12
e) \n
f) 1.22e+6
g) 0Xbcd
4. Draw a flowchart to decide PASS or FAIL from the given mark. (Assuming 50 marks and
above is considered PASS).