Lab #1
INTRODUCTION TO COMPUTER PROGRAMMING, CS-201
Topic: “Introduction to Programming, Hands on
practice on basic tool (creating, updating and
editing of the source code and compiling of object
code).””
BOOK: Deitel & Deitel – C++ How to Program
(10 th Edition)
Chapter 1: 1.9 and 1.10
101 EC
20/05/2024 Total no. of slides = 14
Learning Objectives
After the lesson learners will learn about
creating a project in the code block
Building the executable code
Running the executable code
Output of the code
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
◦Let's create our first C++ file.
◦Open DEV C++, TURBO C++, Visual C++ or
Codeblocks and go to File > New > Empty
File.
◦Write the following C++ code and save the
file as myfirstprogram.cpp (File > Save File
as):
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Double click on the desktop icon:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF ASGHAR KHAN
ACADEMEY, RISALPUR
PROCEDURE:
Click on File:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Click on Console application:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Choose Next option:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Select C++ :
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Write the title and choose the Folder for the project:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Select the compiler:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
Open the project:
PROCEDURE:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
PROCEDURE:
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
LAB EXERCISE 1:
Step 1: Write the source code
Step 2: Build the executable code
Step 3: Run the executable code
Step 4: Give the brief explanation of the program
Useful link
https://www.youtube.com/watch?v=_NethtgMc64
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,