You are on page 1of 25

Programming Fundamentals

Session : SP-2021
Course Code : CSC103
Language as a tool : C Language (IDE)

Credit Hours :3
Course : Project Based
Proposal Submission :

Project Submission :

By: Ameen Khowaja


(Lecturer CS)
Important things for the course
Assignments
Quizzes
Project

Trunitin
LMS
Books and Lab Manual Recommended

Book:
1. How to Program in C?
by Paul and Harvey Deitel

2. Problem Solving and Program Design in C 7e


by Jeri R. Hanly, B. Koffman.
HEC APPROVED COURSE OUTLINES
- Programming and problem analysis.

- Development of basic algorithms.

- Translation of algorithms into programs.

- Standard Data Types. Basic control structures.

- Functions.

- Structured data types; Arrays, Structures, Pointers and Files.

- Debugging and testing programs.


- Programming techniques
Objectives
 To know how the basics of programming
 Designing algorithms and writing in IDE
 Writing code and compilation process
 To work with Iterations, controlled statements, graphics,
filing and be able to program in C
 To better understand the structured and procedural
programming language and differences in both.
 Understanding about the re-usability of the program.
 How to be the best programmer
What is the computer actually
 INPUT
 PROCESS
 OUTPUT
 STORAGE
TRANSLATORS
 INTERPRETER
 COMPILER
 ASSEMBLERS
TYPES OF LANGUAGES
 High level
 Middle level
 Low level
TERMS
CODE
SOURCE CODE
OBJECT CODE
MACHINE CODE
PROGRAM
PROGRAMMING
Structured Programming?
 It is also known as Modular Programming
 Subset of procedural programming
 More easier to understand and modify
 First suggested by Carrado Bohm and Cuiseppe Jacopni
General Information about Languages

Language
 A vocabulary and set of grammatical rules for instructing a computer to perform
specific tasks. The term programming language usually refers to high-level
languages, such as BASIC, C, C++, COBOL, FORTRAN, Ada, and Pascal. Each language
has a unique set of keywords (words that it understands) and a special syntax for
arrangement of program instructions.

C Language
 Developed in 1972 by Dennis Richie in Bell Labs located in USA (AT&T)
 General purpose high-level language
 Originally developed for Unix operating system
 Unix and Virtually all Unix applications are written in C language
 Used in embedded systems, developing system applications, also used to develop the
desktop applications.
 Most of the applications of adobe are developed using C language
General Information about C
Popularity
 Due to its flexibility of its  Kernels of windows are
use of memory management written in C
 C can manage easily and  Its hard because computers
effectively to the system are complicated and C only
level resources by its provides a small amount of
flexibility abstraction away from how
 Memory can be accessed computer works.
easily.  We can work with hardware
 Good choice for system programming using C
level programming
 Modularity
 Easy to handle / write code
 Debugging is easy
 Best for starting career as
programmer
Other programming languages and
usefulness.
Python JAVA
 Easy to learn  Object Oriented
 Open source  Platform independent
 Easy integration with web services  Famous for its portability, write
 Data Structures are user friendly. once and run anywhere
 GUI based desktop application  Widely used in web and application
 It is very popular for machine learning development as well as Big Data.
and deep learning  Platforms : Web, Mobile and
 Useful to create popular video games Desktop
 Used for accuracy using scientific and
computational applications.
 Platform web and desktop both
Other programming languages and
usefulness.
Java Script and Type Script Swift
 Object Oriented CPL  Apple developed swift in 2014
 Commonly used to create  Became popular in march 2017
interactive effects inside web  Open Source PL
browsers.
 Easy to learn
 Type Script is a superset of Java
Script
 Also used at the front end of
several popular websites like
google, Wikipedia, Youtube and
Amazon.
Other programming languages and
usefulness.
C# (C sharp) C & C++
 Microsoft  Oldest commonly used PL
 One of the powerful PL  It is root of other PLs
 More like C++  Learning C first provides a valuable
foundation for C++ or any other
 Suited for applications on windows,
language
Android, and iOS.
 C and C++ are considered as high
 Bing, Dell, Visual Studio developed
performance languages
in C#
What is programming
DEFINITION
A “Program” is a precise sequence of steps to solve a
particular task/problem.

That means if we say “we have a program” means we have


already a set of activities to perform in a sequence. The
purpose of performing activities is to solve the particular
issue / task/problem
Computer Programming : Mr. Steve Summit
“Computer Program is simply tells computer what to do.”

Why Programming is Important?


1. Traditional forms are available and useful to just few
peoples
2. Others are useful for everyone

It is important because it develops analytical and problem


solving abilities. It is a creative activity, and provides us a mean
to express ideas from raw abstracts.
It’s a vocational skill: Critical Reading, Analytical Thinking etc.
Skills are needed?
People lives and living depends on programs, so it is very
important activity. Programmers should:

 Paying attention on details


 Think about the reusability of programs
 Think about user interface
 Understand the facts that computers are just following the
instructions having no their own decision power or senses.
 Comment the code liberally for better understanding of the
code for other programmers for modification and editing in
the future.
Paying attentions to details
A good programmer analyzes the problem statement very
carefully and in details
Think about the reusability
When you write a program code for a particular task, then keep
in mind that I shall reused it some other time. Suppose we use
to write for knowing the area of a circle, formula is: (pi*r2),
now you see the code for knowing about the circle, wheel, ring
and any other circular would be the same.
Think about Good user interface.
Don’t think that computer end user knows all / lot of things.
Create a user friendly environment for users
Understand that computers are just following the instructions
Computers do what we say, they have no own decision power.
The capability of programmer is actually capability of computer
And the capability of code written in any language.
They differs from human, they do maximum what the capability
of the programmers. They just do the same thing what they
have been told through program code.
Comment the code liberally
Comments of the code is actually part of documentation,
ignored by the compiler, written in English like manner for
understanding a peace of code for other programmers to
understand better about the code, functionality and the
algorithms.
Program Design Recipe
Prepare a recipe effectively to follow. The programmer is like
an architect, a composer or a writer. These are creative people
who start with a raw idea and implement it through a code.
Points to remember
 Don’t assume on the part of a user.
 User interface should be friendly.
 Don’t forget to comment the code.
 Pay attention to details.
 Concentrate same time on the Analysis, Design,
Implementation, Testing and Debugging.
 If you leave the errors of analysis and design then feel the
disaster.
Graphical
Representation
of writing and
execution of
program.
Software Categories
Application software 
application software office suites, word processors, spreadsheets, etc
(No direct interaction with hardware)

System software
operating systems, device drivers
(Directly interacting with Hardware)

Computer programming tools 


Assemblers, compilers, linkers may or may not interact with the user and hardware
directly.

The first two of these are classified for running software on computers
(i.e., actually using the computers),

while the last one is about developing the software that may or May not interact with the
hardware directly.
The Main Function void main()
 It is a part of every program which is itself a function and
calls all other functions used in the program.
 The parentheses after main indicate the block of program
code within main or any structure called body of the code.
 Every C program begins execution at the main function.
 The main is by-default “void” but may have some other data
types like int main() etc.
 Main declared as integer may return any whole number
 The void in main parentheses means main does not receive
any information.
First Program in C
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(“My First Program”);
getch();
}
________________________________________________________________________
Note:

1. C is a case sensitive language having some rules and regulation to write a


program.

2. C is also known as structured, middle level, modular Programming Language

You might also like