You are on page 1of 6

Fundamentals of Programming

Lab 1

Dr. Syed Saif ur Rahman
F
u
n
d
a
m
e
n
t
a
l
s

o
f

P
r
o
g
r
a
m
m
i
n
g

Required skill-set
Understanding of how to operate in console
environment in DOS or LINUX

Self-study DOS commands

Self-study LINUX commands
2
F
u
n
d
a
m
e
n
t
a
l
s

o
f

P
r
o
g
r
a
m
m
i
n
g

Lab 1 Steps
Open notepad
Write your program
Compile with following command
gcc hello.c
An output with name a.exe will be generated for
correct program. Run a.exe to execute program
Compile the same program again with following
command
Gcc hello.c -o hello.exe
This will create output executable file with
hello.exe
3
F
u
n
d
a
m
e
n
t
a
l
s

o
f

P
r
o
g
r
a
m
m
i
n
g

Lab 1 Task
Write and execute following programs yourself
(Please dont copy past!)
C How To Program (Sixth Edition)
Fig. 2.1 Page 24
Fig 2.3 Page 27
Fig 2.4 Page 28

4
Home Assignment Lab 1
5
F
u
n
d
a
m
e
n
t
a
l
s

o
f

P
r
o
g
r
a
m
m
i
n
g

Using Notepad++ for C programming
Notepad++ as editor for C Development
http://comprograddicts.blogspot.com/2014/08/note
pad-as-editor-for-c-development.html
Compile with Notepad++ (Any language)
http://windowsbro.blogspot.com/2012/10/compile-
with-notepad-any-language.html
How to compile C++ code in Notepad++ with
gcc/g++
http://daleswanson.blogspot.com/2012/07/how-to-
compile-c-code-in-notepad-with.html
6

You might also like