You are on page 1of 2

ECP1016 - Computer and Program Design

Tutorial 1 – Introduction to Dev-C++

Section A: Student self-learning, reading and preparation before coming to the tutorial class

1. Familiarize with Dev-C++ environment

For a soft copy of Dev-C++, download from


https://sourceforge.net/projects/orwelldevcpp/
2. Self-Reading Materials
https://www.youtube.com/watch?v=xAmD09fZcaA

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 first program in C*/


#include <stdio.h>
int main()
{
printf(“Hello World”);
printf(“\n”);
return 0;
}

Change printf(“Hello World”); to

a) printf(“Hello ”);
printf(“World”);
b) printf(“Hello\nWorld”);
c) printf(“Hello\tWorld\n\n\n”);
d) printf(“There is no class tomorrow! \n”);

What do you see on your monitor screen for each case?

1
2. Write a C program that will display as following output:

Welcome to my first Matrix Printout assignment:

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).

You might also like