You are on page 1of 44

CSC1103: Fundamentals of Programming [ C ]

Lecture 1

Fall 2023

Syed Muhammad Hassan


Email: syed.hassan@szabist.pk
1
Lecture Plan

• Introduction
Fundamentals of Programming

• Course Syllabus

• Sample C Program

• Chapter 1: Introducing C

2
Introduction
• Introduce yourself.
Fundamentals of Programming

3
Course Overview
• Course
• Class Timings
Fundamentals of Programming

• Course Material
• Marks Instruments
• Grading
• Attendance
• What to Avoid
• Keys to Success
• Syllabus / Topics
4
Course Credit Hours
• Fundamentals of Programming: 4 Credit Hours Course
– Theory: 3 Credit Hours ( 1 Classes / Week )
Fundamentals of Programming

– Instructor: Syed Muhammad Hassan

– Lab: 1 Credit Hour (1 Labs / Week )


– Instructor: ?

5
Course Objectives
• Course Objective:
– Learning about problem solving skills
Fundamentals of Programming

– Learn logic building


– Writing pseudo code
– Getting familiarized with basic building blocks and programming constructs of PL.
– Enabling Students to develop analytical skills and solve practical programming problems.

• Teaching and Learning Methodology:


– Lectures
– Live Code Demonstration
– Writing Pseudo Code
– Readings and Assessments
– Class Discussion and Student Participation
7
Course Material
• ZABDESK:
https://fallzabdesk.szabist.edu.pk/
Fundamentals of Programming

• Google Class Room


• Questions/Discussions:
– Preferably on email: syed.hassan@szabist.pk
– OR Class Break
– OR by appointment through email

8
Books
• Text Book:
• C Programming: A Modern Approach by K. N. King
2nd Edition, W. W. Norton & Company, 2008.
Fundamentals of Programming

• Reference Books:
• Effective C: An Introduction to Professional C Programming, Robert C. Seacord, No Starch
Press ,2020
• Learn C Programming: A beginners guide to learning C programming the easy and disciplined way,
Jeff Szuhay, 1st Edition, Packt Publishing,2020
• Programming in C, Stephen G. Kochan , 4th Edition, Addison-Wesley,2014
• C Programming Absolute Beginners Guide, Greg Perry, Dean Miller , 3rd Edition, Que
Publishing,2013
• Let Us C, by Yashavant P. Kanetkar, 8th Edition, Jones & Bartlett Learning,2008
12
Attendance
• As per SZABIST Official Policy
• Maximum THREE Absences allowed in CS Program
Fundamentals of Programming

13
What to avoid?
• Things to avoid
• Coming late
Fundamentals of Programming

• Marked late if found absent during attendance.


• Two lates are considered equivalent to 1 absent

• Use of Mobile phones during lecture


• Strictly prohibited

• Disturbing others during lecture

• Plagiarism

14
Plagiarism
• You must never copy solutions from any source or give your
homework to another student. Cheating will result in a failing grade
Fundamentals of Programming

for the course.

• However, you are allowed and encouraged to discuss the exercises.


This means asking for suggestions when you are stuck and discussing
examples that are similar but not part of the exercise. You must never
share code or solutions to the assigned problems.

15
Course Syllabus
• Introducing C
• First Program in C
Fundamentals of Programming

• C Fundamentals
• Formatted Input / Output
• Expressions
• Selection Statements
• Loops, Basic Types
• Arrays
• Functions
16
Course Syllabus
• Passing Arguments to Functions
• Scope Rules
Fundamentals of Programming

• Program Organization
• Debugging and Error Tracking
• Pointers
• Pointers for Array Processing
• String, [ Searching, Sorting]
• Structures, Unions, Enumerations
• Filing
17
Online Learning
• Coursera, https://www.coursera.org/
• Udemy, https://www.udemy.com/
Fundamentals of Programming

• edX, https://www.edx.org/
• Stanford Engineering Everywhere, http://see.stanford.edu/see/courses.aspx
• MITOpenCourseWare https://ocw.mit.edu
• Big Data University, http://bigdatauniversity.com/
• OpenSAP, https://open.sap.com/
• Khan Academy, http://www.khanacademy.org/
18
Online Learning
• Udacity, http://www.udacity.com/
• Skillshare, http://www.skillshare.com/
Fundamentals of Programming

• Venture Lab, https://venturelab.stanford.edu/

19
Class Focal Person
• Class Representative.
• Name?
Fundamentals of Programming

20
Any Questions?
• Should you have any questions, please don’t hesitate to ask.
Fundamentals of Programming

21
Course Pre-requisites
• Not Applicable
Fundamentals of Programming

22
Keys to success
• Code, code and code….
• You can’t remember coding….
Fundamentals of Programming

• You can’t learn coding…


• You practice and learn coding…
• Practical hands on experience of real world programming problems is very
helpful.
• Find yourself problems beyond what is discussed in class.
• Always read/revise previous lectures before coming to class or any related
material discussed previously.
• Looking up and solutions, and assignment are always very important
23
Good Computer Scientist
• Self-learner
• Desire for innovations
Fundamentals of Programming

• Think logically
• Avoids distractions and follows a plan
• Keeps patience and focuses on the target
• Over the time acquires knowledge of computer science application
domains
• Is a good team worker with good communication skills
• Takes care of his/her health
24
Fundamentals of Programming

25
Fundamentals of Programming

26
Fundamentals of Programming

27
Fundamentals of Programming

28
Fundamentals of Programming

29
Fundamentals of Programming

30
Fundamentals of Programming

31
Fundamentals of Programming

32
Fundamentals of Programming

33
Fundamentals of Programming

34
Fundamentals of Programming

35
Fundamentals of Programming

36
Fundamentals of Programming

37
Fundamentals of Programming

38
Fundamentals of Programming

39
Advantages of C
• Advantages

– Efficient: Runs quickly, Programs may execute on systems with limited memory.
Fundamentals of Programming

– Portable: Program can run from PCs to Supercomputers

– Powerful: Lots of data types and operators

– Flexible: Used for both system programming and applications

– Standard library: Rich set of features

– Integrated well with UNIX: Self explanatory.

40
Disadvantages of C
• Disadvantages
– Error-prone
Fundamentals of Programming

– Difficult to understand

– Difficult to maintain

41
C Program Compilation

C Code
Fundamentals of Programming

42
C Program Compilation (Another View)
Fundamentals of Programming

43
Preprocessor

The Preprocessor accepts source code as input and is responsible for:


• removing comments
Fundamentals of Programming

• interpreting special preprocessor directives denoted by #.

For example
#include -- includes contents of a named file. Files usually called header files. e.g
#include <math.h> -- standard library maths file.
#include <stdio.h> -- standard library I/O file
#define -- defines a symbolic name or constant. Macro substitution.
#define MAX_ARRAY_SIZE 100

44
C Compiler

• The C compiler translates source to assembly code.


• The source code is received from the preprocessor.
Fundamentals of Programming

45
Assembler

• The assembler creates object code that represents Machine Code or


Fundamentals of Programming

low level instructions for the processor.

• On a UNIX system you may see files with a .o suffix (.OBJ on MSDOS)
to indicate object code files.

46
Link Editor

If a source file references library functions or functions defined in other


Fundamentals of Programming

source files the link editor combines these functions (with main()) to
create an executable file ( .exe file ) . External Variable references are
also resolved here.

47
Fundamentals of Programming

48

You might also like