Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
65 views

C Language Course Outline

This document discusses C language basics and programming fundamentals. It covers topics such as introduction to programming, algorithms and flowcharts, software and hardware, and computer programming languages. It defines key terms like program, algorithm, flowchart, hardware, software, high-level and low-level languages. It describes the relationship between hardware and software and explains how they work together. It also discusses the different components of an integrated development environment for C language programming.

Uploaded by

rehman
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

C Language Course Outline

This document discusses C language basics and programming fundamentals. It covers topics such as introduction to programming, algorithms and flowcharts, software and hardware, and computer programming languages. It defines key terms like program, algorithm, flowchart, hardware, software, high-level and low-level languages. It describes the relationship between hardware and software and explains how they work together. It also discusses the different components of an integrated development environment for C language programming.

Uploaded by

rehman
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

- : C Language Basics & Programming

Fundamentals
1. Introduction to Programming
 Program Definition
 Advantages of Program
 Algorithm
 Flow Chart
 Difference b/w Algorithm and Flow Chart

2. Software & Hardware


 Hardware
 Software
 Categories of Software
 Difference b/w Hardware & Software

3. Computer Programming Languages


 Computer Programming Languages Overview
 Low Level Languages
 High Level Languages
 Difference b/w High Level & Low Level Languages

4. IDE of C Language
 Editor
 Preprocessors
 Compiler/Interpreter
 Debugger
 Linker
 Loader
 Difference b/w Compiler & Interpreter
Introduction to Programming
Go To Home
Program
Definition: "A program is a precise sequence of steps to solve a particular problem.”
A set instructions that tells a computer what to do is called program. A computer works according to
the given instructions in the program .Computer programs are written in programming language. A
person who develop a program is called programmer.

Advantages of Computer Program


They includes:

 A computer program can solve many problems by giving instructions to


computer.

 A program can be used to perform a task repeatedly and quickly.

 A program can process large amount of data easily, rapidly &


accurately.

 It can display results in different ways as per user demand.

 Different programs are used to perform tasks in different fields.

 Program is important because it develops analytical and problem solving


abilities.

How to Design a Program


While programming one should remember the following points:

 Paying attention in detail to particular task about which a program has to


design.
 Think about the reusability.
 Think about user interface
 Understand the fact the computers are stupid
 Comment the code liberally

1-: Algorithms – Pseudo Code


-: Algorithm
In this part a developer step by step designs logic of a particular task.

It must include:
o Broken down simple & meaningful steps
o Steps should be numbered sequentially
o Steps should be descriptive and in simple English

-: Pseudo Code
In this part a algorithm converted in program.

It must include:
o Steps of algorithm is converted in to programming language
o The running time can be estimated in a more general manner by using Pseudo

code to represent the algorithm as a set of fundamental operations which can


then be counted Steps should be descriptive and in simple English

For example, following is an algorithm for Insertion Sort.

 Algorithm: Insertion-Sort
 Input: A list L of integers of length n
 Output: A sorted list L1 containing those integers present in L
 Step 1: Keep a sorted list L1 which starts off empty
 Step 2: Perform Step 3 for each element in the original list L
 Step 3: Insert it into the correct position in the sorted list L1.
 Step 4: Return the sorted list
 Step 5: Stop

Here is a pseudo code which describes how the high level abstract process mentioned above
in the algorithm Insertion-Sort could be described in a more realistic way.

 for i <- 1 to length(A)


 x <- A[i]
 j <- i
 while j > 0 and A[j-1] > x
 A[j] <- A[j-1]
 j <- j - 1
 A[j] <- x
Difference between Algorithm and Pseudo code
 An algorithm is a formal definition with some specific characteristics that describes a process,
which could be executed by a Turing-complete computer machine to perform a specific task.
Generally, the word "algorithm" can be used to describe any high level task in computer science.
 On the other hand, pseudocode is an informal and (often rudimentary) human readable
description of an algorithm leaving many granular details of it. Writing a pseudocode has no
restriction of styles and its only objective is to describe the high level steps of algorithm in a
much realistic manner in natural language.

Example 1 (Algorithm)
Adding two numbers have the following logical steps
1 Start
2 Input A
3 Input B
4 Total =A+B
5 Print Total
6 Exit
Example 2 (Algorithm)
Input radius from user & calculate area of circle (Hint Area=3.14*radios*radios)
1 Star
2 Input radius in r
3 Area=3.14*r*r
4 print Area
5 Exit
Example 3 (Algorithm)
Sum of first fifty Natural numbers (1, 2, 3-----50)
1 Star
2 Sum=0
3 N=0
4 Repeat step 5 n 6 while (N<=50)
5 Sum=Sum+N
6 N=N+1
7 Print Sum
8 Exit

Advantages of Algorithm
o Reduce complexity
o Increased Flexibility
o Ease of Understanding

2-: Flow Chart


In this part a developer describe Flow means direction &Char refers to symbols

Or Flow Char is the graphical representation of algorithms

Use of Flow Chart


o Represent Algorithm in simple graphical manner
o Show steps in easy way
o Understand the Flow of program
o Improve the logic to solve a problem
o Reviewed & Debug easily

Symbols of Flow Chart


o Input/output

Parallelogram is used to mark input/output

Input Output

o Process
Rectangle is used to represent process like mathematical
expressions

Sum=A+B

o Selection
Diamond is used to represent selection

N > 50
o Star/End
Oval is used to represent Star/End

Start End

o Flow Lines
Arrow is used to represent Flow Lines

o Connector
Circle is used to represent and combine different Flow Lines

o Function Call
Rectangle is used to represent Function Call with double
lines on right and left side. Function name with parameters
is written inside the rectangle

o Preparation
It is used for loop with condition

Guidelines for Developing Flowcharts


These are some points to keep in mind while developing a flowchart −

 Flowchart can have only one start and one stop symbol
 On-page connectors are referenced using numbers

 Off-page connectors are referenced using alphabets

 General flow of processes is top to bottom or left to right

 Arrows should not cross each other

Example Flowcharts
Here is the flowchart for going to the market to purchase a pen.

Here is a flowchart to calculate the average of two numbers.


Difference b/w Algorithm & Flow Chart
It includes

-: Flowcharts
1. Standard symbols are used to design Flowchart
2. Flow is more time consuming
3. It is difficult to modify
4. It is a graphical representation of solution
-: Algorithm
1. Simple English used to design Algorithm
2. It is less time consuming
3. It is easy to modify
4. It is a step by step process to solve a problem

Hardware & Software


Go To Home
Hardware
Hardware represents the physical and tangible components of a computer, i.e. the components
that can be seen and touched.

Examples of Hardware are the following −

 Input devices − keyboard, mouse, etc.

 Output devices − printer, monitor, etc.

 Secondary storage devices − Hard disk, CD, DVD, etc.

 Internal components − CPU, motherboard, RAM, etc.

Relationship between Hardware and Software


 Hardware and software are mutually dependent on each other. Both of them must work
together to make a computer produce a useful output.

 Software cannot be utilized without supporting hardware.

 Hardware without a set of programs to operate upon cannot be utilized and is useless.

 To get a particular job done on the computer, relevant software should be loaded into the
hardware.

 Hardware is a one-time expense.

 Software development is very expensive and is a continuing expense.


 Different software applications can be loaded on a hardware to run different jobs.

 A software acts as an interface between the user and the hardware.

 If the hardware is the 'heart' of a computer system, then the software is its 'soul'. Both are
complementary to each other.

Software
Software is a set of programs, which is designed to perform a well-defined function. A program is a
sequence of instructions written to solve a particular problem.

There are two types of software −

 System Software

 Application Software

System Software
The system software is a collection of programs designed to operate, control, and extend the processing
capabilities of the computer itself. System software is generally prepared by the computer
manufacturers. These software products comprise of programs written in low-level languages, which
interact with the hardware at a very basic level. System software serves as the interface between the
hardware and the end users.

Sub categories of system software are:


O Operating system (Windows, Android, Linux etc)
O Device drivers (VGA, Sound, USB Port, Super Drive etc)
O Utilities (Antivirus, Disk Management, DVD Writing etc)
Some examples of system software are Operating System, Compilers, Interpreter, Assemblers, etc.

Here is a list of some of the most prominent features of system software −

 Close to the system

 Fast in speed

 Difficult to design

 Difficult to understand

 Less interactive
 Smaller in size

 Difficult to manipulate

 Generally written in low-level language

Application Software
Application software products are designed to satisfy a particular need of a particular environment. All
software applications prepared in the computer lab can come under the category of Application software.

Application software may consist of a single program, such as Microsoft's notepad for writing and editing
a simple text. It may also consist of a collection of programs, often called a software package, which
work together to accomplish a task, such as a spreadsheet package.

Examples of Application software are the following −

 Payroll Software

 Student Record Software

 Inventory Management Software

 Income Tax Software

 Railways Reservation Software

 Microsoft Office Suite Software

 Microsoft Word

 Microsoft Excel

 Microsoft PowerPoint

Features of application software are as follows −

 Close to the user

 Easy to design

 More interactive

 Slow in speed

 Generally written in high-level language

 Easy to understand

 Easy to manipulate and use


 Bigger in size and requires large storage space

Difference b/w Hardware & Software


The following table highlights the points that differentiate a hardware from a software.

Hardware Software

It is the programming language that makes


It is the physical component of a computer system.
hardware functional.

It has the permanent shape and structure, which It can be modified and reused, as it has no
cannot be modified. permanent shape and structure.

The external agents such as dust, mouse, insects, The external agents such as dust, mouse, insects,
humidity, heat, etc. can affect the hardware (as it is humidity, heat, etc. cannot affect (as it is not
tangible). tangible).

It functions with the help of high level language like


It works with binary code (i.e., 1’s to 0’s) .
COBOL, BASIC, JAVA, etc.

It takes in only machine language, i.e., lower level It takes in higher level language, easily readable by a
language. human being.

It is not affected by the computer bug or virus. It is affected by the computer bug or virus.

It cannot be transferred from one place to other


It can transfer from one place to other electronically.
electronically.

A user can create copies of a software as many as


Duplicate copy of hardware cannot be created.
he wishes.

Computer Programming Languages


Go To Home
The computer system is simply a machine and hence it cannot perform any work; therefore,
in order to make it functional different languages are developed, which are known as programming
languages or simply computer languages.

Over the last two decades, dozens of computer languages have been developed. Each of these
languages comes with its own set of vocabulary and rules, better known as syntax. Furthermore, while
writing the computer language, syntax has to be followed literally, as even a small mistake will result in
an error and not generate the required output.

Following are the major categories of Programming Languages −

 Low Level Language


Machine Language or Code
This is the language that is written for the computer hardware. Such language is affected
directly by the central processing unit (CPU) of a computer system.
Assembly Language
It is a language of an encoding (Symbols) of machine code that makes simpler and
readable.

 High Level Language


The high level language is simple and easy to understand and it is similar to English language. For
example , COBOL, FORTRAN, BASIC, C, C+, Python, etc.

High-level languages are very important, as they help in developing complex software and they have the
following advantages −

 Unlike assembly language or machine language, users do not need to learn the high-level
language in order to work with it.
 High-level languages are similar to natural languages, therefore, easy to learn and
understand.
 High-level language is designed in such a way that it detects the errors immediately.
 High-level language is easy to maintain and it can be easily modified.
 High-level language makes development faster.
 High-level language is comparatively cheaper to develop.
 High-level language is easier to document.

Although a high-level language has many benefits, yet it also has a drawback. It has poor control on
machine/hardware.

The following table lists down the frequently used languages −


-: Differences between low level and high level programming
language.

Low level language High level language

They are faster than high level language. They are comparatively slower.

Low level languages are memory efficient. High level languages are not memory efficient.

Low level languages are difficult to learn. High level languages are easy to learn.

Programming in low level requires additional Programmings in high level do not require any

knowledge of the computer architecture. additional knowledge of the computer architecture.

They are machine dependent and are not portable. They are machine independent and portable.

They provide less or no abstraction from the


They provide high abstraction from the hardware.
hardware.

They are more error prone. They are less error prone.

Debugging and maintenance is difficult. Debugging and maintenance is comparatively easier.


They are generally used for developing system They are used to develop a variety of applications such

software’s (Operating systems) and embedded as – desktop applications, websites, mobile software’s

applications. etc.

You might also like