You are on page 1of 4

LAB 1: Dev-C++ Starting

Objective:

i. Define what is Dev-C++ as compiler


ii. Create new project/file using Dev
iii. Write simple C++ program
iv. Compile and Execute/run program.

Instruction:
i. Open the Dev C++ program.
ii. Follow the instructions (Task 1 and Task 2)
iii. Find the output.
iv. Submit the answer.

What is Dev-C++?

Dev-C++, one of C++ compiler that developed by Bloodshed Software, is a fully featured graphical
IDE (Integrated Development Environment), which is able to create Windows or console-based C/C++
programs using the MinGW compiler system. MinGW (Minimalist GNU* for Windows) uses GCC
(the GNU g++ compiler collection), which is essentially the same compiler system that is in Cygwin
(the unix environment program for Windows) and most versions of Linux.

Task 1 : Using Dev-C++


Step 1: Create a new project.

A "project" can be considered as a container that is used to store all the elements that are
required to compile a program.

 Go to the "File" menu and select "New", "Project...".


 Choose "Empty Project" and make sure "C++ project" is selected.
Here you will also give your project a name as “Project1”.
 Once you have entered a name for your project, click "OK".
 Dev-C++ will now ask you where to save your project. Save the project on your own
folder. (MyDocument/YourName)

Step 2: Create/add source file(s).

You can add empty source files one of two ways:

 Go to the "File" menu and select "New ->Source File" (or just press CTRL+N)
OR

 Go to the "Project" menu and select "New File".

 Type the following code segment:

 Note that Dev-C++ will not ask for a filename for any new source file until you
attempt to:
1. Compile (Execute -> Compile)
 Save file as „Exercise1.cpp”
 If define error, fix the errors.
2. Run Program (Execute -> Run)
3. Exit Dev-C++
Task 2 : Exercises
1. Write a program that displays the output of your personal information

2. What does the following code print?

cout<< “*\n**\n***\n****\n*****\n”;

3. Write a C++ program that will display the output below. Use cout statements.

a) *************************************
* Lab Exercise *
* Principles of Programming *
* Programmer : Ali bin Abu *
* Date : 29 November, 2011 *
*************************************

b) ****************************

*********WELCOME********

=========(^_^)==========

=======================

***********HOME*********

****************************

You might also like