SlideShare a Scribd company logo
SHROFF S R ROTARY
INSTITUTE OF CHEMICAL
TECHNOLOGY
COMPUTER PROGRAMMING AND
UTILIZATION
ME SECOND SEMESTER
PREPARED BY:
NAVED FRUITWALA (150990119006)
UTKARSH GANDHI (150990119007)
DIGVIJAYSINH GOHIL (150990119008)
TOPIC:
ALGORITHMS, FLOW
CHARTS, HARDWARE,
SOFTWARE, STRUCTURE OF
C PROGRAM , C TOKENS.
ALGORITHMS:
• An algorithm is the finite set of sequential
instructions to accomplish a task where instructions
are written in natural languages like English. It is
also called as a step by step solution of the
problem.
• Space complexity specifies the amount of memory
space required by the algorithm for performing the
desired task.
PROPERTIES/CHARACTERISTIC
S OF THE ALGORITHM:
• Algorithm has four properties, that are finiteness, definiteness,
effectiveness, input and output. They are explained below.
• Finiteness: Total number of steps used in algorithm should
be finite.
• Definiteness: Each step of algorithm must be clear and
unambiguous.
• Effectiveness: Every step must be basic and essential.
• Input & Output: The algorithm must accept zero or more
input and must produce at least one output.
ADVANTAGES:
• Very easy to write.
• Easy technique to understand topic.
• Easy identification of the mistakes by non computer
person.
Disadvantages:
• Time consuming.
• Difficult to show branching and looping.
• Big tasks are difficult to put in algorithm.
EXAMPLES:
1) Write an algorithm to calculate area of rectangle.
• Algorithm:
Step 1: Accept the value of length i.e. L
Step 2: Accept the value of breadth i.e. B
Step 3:Calculate area i.e. A=L*B
Step 4: Print Area i.e. Print A
Step 5: Stop procedure
FLOWCHARTS:
• A flowchart can be define as the pictorial
representation of a process which describes the
sequence and flow of control and information within
the process.
• The various symbols used in a flowchart.
Symbol Name Uses
Start and stop
symbols
Used to start
flow chart as
well as to
terminate the
flow chart.
Input / Output Used for IO
operation
Process Used to mention
ALU and data
transfer task(i.e.
Arithmetic or
assignment
start
stop
Yes/true
Decision For branching
condition
Flow lines Indicates flow
Loop Indicates finite
loop
Connectors Connecting flow
lines from
different places
Tes
t
?
no/
fals
e
initializ
ation
Next
A
A
Multiple
section
For multiple
branching
condition
Block Indicates block of
statements or
body of loop
Module call Calling the
subroutine or
function
Test
?
ADVANTAGES :
• Easy to draw.
• Easy technique to understand logic.
• Easy to identify the mistakes by non computer person.
• Easy for branching and looping.
Disadvantages :
• Time consuming.
• Difficult for modification.
• Difficult task to draw flow charts for big problems.
EXAMPLES :
1) Draw a flow chart to find the average of marks
obtained by a student in three subjects.
• Flow chart :
start
Read marks 1,2,3
Avg= marks (1+2+3)/3
Print avg
stop
HARDWARE• Hardware is the physical
components which are
touchable and sensible.
It is mainly divided into 4
parts-CPU, input device,
output device and
auxiliary memory.
• CPU is the Central
Processing Unit which
contain electronics
circuit and used to
execute instructions and
also controls the
operation of other input
HARDWARE
• CPU accepts information from user through input
device. There are many input devices like
keyboard, mouse, microphone, tracker balls, touch
screens.
• CPU conveys information to user through output
devices. There are many output devices like
monitor, LCD, printers, plotters, speaker.
• Auxiliary memory is also called as a secondary
memory or external memory or magnetic memory.
This is permanent memory. User can store data
Computer programming and utilization
Computer programming and utilization
Computer programming and utilization
COMPUTER SOFTWARE
PROGRAM IS THE COLLECTION OF INSTRUCTIONS, WHICH
PERFORMS PARTICULAR TASK, AND COLLECTION OF
PROGRAMS WHICH ACCOMPLISHES APPLICATION (THAT
MEANS NUMBER OF TASKS) IS CALLED AS A SOFTWARE. THIS
SOFTWARE IS CLASSIFIED INTO TWO CATEGORIES - SYSTEM
SOFTWARE AND APPLICATION SOFTWARE. SYSTEM
SOFTWARE DIRECTLY INTERACTS WITH COMPUTER
HARDWARE, WHEREAS APPLICATION SOFTWARE IS ONLY
DESIGNED TO SOLVE USER PROBLEMS AS PER USERS
REQUIREMENT.
TYPES OF SOFTWARE :- (1) SYSTEM SOFTWARE
(2)APPLICATION SOFTWARE
System Software
System software is classified into 3 categories:
(1) Operating System
(2)system support software and
(3) system development software
• Operating system manages hardware as well as interacts with
user‚ and provides different services to users. There are many
operating systems like DOS, Windows-XP,VISTA‚ LINUX etc.
• System support software manages hardware more efficiently. for
example drivers of the IO devices or antivirus software.
• System development software supports programming
development environment to user. It include editor, pre-processors,
compiler, interpreter, loader etc.
• Editor is the software ‚ which is used to create
programs as well as it is used for modification of existing
programs.
• Pre-processor is the software which is used before
translators (that means compiler or editors) , which is
used to replace some segments of code With some
another segment. It is also called as an expansion.
• Compilers are the software which can translate high
level programs into low level programs.
• Interpreters are the software which can translate line by
line high level programs into low level programs
• Loaders are the software which can load object codes
into the main memory and execute it.
APPLICATION SOFTWARE
• Application software is classified into two categories :
General purpose Software and Special purpose
software.
• General purpose software is used for many number of
tasks, and provides many features for example word
processor, oracle, excel etc.
• Special purpose software is designed for Specific
purposes only. User programs comes under special
purpose software for example pay roll system for specific
STRUCTURE OF C PROGRAM
Documentation Section
/*It tells purpose of C programs, author name and etc */
//Program to add 2 nos
Link Section
#include<stdio.h>
Definition Section
#define PI 3.1414
cont…….
Global Declaration Section
Main() function Section
main()
{
Variable declaration/Initialization Section;
Program statements or Executable Section;
}
Subprogram Section
Function1()
{
Variable declaration/Initialization Section;
Program statements or Executable Section;
}
Function2()
{}
• Documentation section consists of comments.
Comments are not executed by the compiler. Single line
comments start with // symbol and multiple line
comments are written within /* and */.
• Link section consists of pre-processor directives which
link the compiler to the standard library functions. We
include different predefined standard library functions in
our C programs.
#include <stdio.h> is a header file that consists of
standard input/output functions like pritnf(), scanf() etc.
#include<math.h> consists of different math functions like
sqrt(), log() etc.
#include<graphics.h> consists of different graphical
functions.
• Definition section defines all symbolic constants like
#define PI 3.14.
• Global declaration section declares the global variables.
These variables can be used in more than one functions.
• main() function is the special and important function used
by C programs to tell the compiler where the program
starts. Every program must have exactly one main()
function.
• The opening { and closing braces } indicate the begin
and end of the main() function.
• Subprogram section contains all user defined functions
that are called in main() functions.
C TOKENS :-
•Smallest individual units in a program are
known as Tokens. The compiler recognizes
them for building up expressions and
statements.
1. KEYWORDS :-
• C language has 32 reversed keywords.
• Since keywords have specific meaning, we cannot use
them as identifiers.
• All keywords are to be written in lower-case letters.
• C keywords :-
auto extern sizeof break static
case for struct char goto
float switch if int
etc…
2. IDENTIFIERS :-
• Alphabets, digits, underscores are permitted.
• They must not begin with a digit.
• First character must be a letter.
• Uppercase and lower case letters are distinct.
• VALID INVALID
A 4abc
Roll_no Roll-no
num2 num-2
3. CONSTANTS :-
• Constants are the identifier that represent fixed values.
• First type is String Character & Literals :-
• Second type is Numeric constants :-
a.) Integer constant
1.) Octal constant
2.) Hex constant
3.) Decimal constant
b.) Floating point constant
4. SYMBOLS :-
5. OPERATORS :-
• It is a symbol that takes one or more operands
(variables, expressions or values) and operates on them
to give an output.
• There are many types of operators :-
1.)Arithmetic
2.)Relational
3.)Logical
4.)Bitwise
5.)Assignment
6.)Unary
7.)Conditional
8.)Special operator
DEFINITION
“An operator is a symbol (+,-,*,/)
that directs the computer to
perform certain mathematical or
logical manipulations and is
usually used to manipulate data
and variables”
Ex: a+b
OPERATORS IN C
1. Arithmetic operators
2. Relational operators
3. Logical operators
4. Assignment operators
5. Increment and decrement operators
6. Conditional operators
7. Bitwise operators
8. Special operators
ARITHMETIC OPERATORS
Operator example Meaning
+ a + b Addition –unary
- a – b Subtraction- unary
* a * b Multiplication
/ a / b Division
% a % b Modulo division- remainder
EXAMPLE 1
X = 9-12/3+3*2-1
= 9-4+6-1
=10
RELATIONAL OPERATORS
Operator Meaning
< Is less than
<= Is less than or equal to
> Is greater than
>= Is greater than or equal to
== Equal to
!= Not equal to
Logical Operators
Operator Meaning
&& Logical AND
|| Logical OR
! Logical NOT
Logical expression or a compound relational
expression-
An expression that combines two or more
relational expressions .
Ex: if (a==b && b==c)
TRUTH TABLE
a b
Value of the expression
a && b a || b
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
ASSIGNMENT OPERATORS
Syntax:
v op = exp;
Where v = variable,
op = shorthand assignment operator
exp = expression
Ex: x=x+3
x+=3
SHORTHAND ASSIGNMENT OPERATORS
Simple assignment
operator
Shorthand operator
a = a+1 a + =1
a = a-1 a - =1
a = a* (m+n) a * = m+n
a = a / (m+n) a / = m+n
a = a %b a %=b
INCREMENT & DECREMENT OPERATORS
C supports 2 useful operators namely
1. Increment ++ operators
2. Decrement -- operators
The ++ operator adds a value 1 to the operand
The – operator subtracts 1 from the operand
++a or a++
--a or a--
RULES FOR ++ & -- OPERATORS
1. These require variables as their operands
2. When postfix either ++ or – is used with the
variable in a given expression, the
expression is evaluated first and then it is
incremented or decremented by one
3. When prefix either ++ or – is used with the
variable in a given expression, it is
incremented or decremented by one first
and then the expression is evaluated with
the new value
EXAMPLES FOR ++ & -- OPERATORS
Let the value of a =5 and b=++a then
a = b =6
Let the value of a = 5 and b=a++ then
a =5 but b=6
i.e.:
1. A prefix operator first adds 1 to the operand
and then the result is assigned to the variable
on the left
2. A postfix operator first assigns the value to
the variable on left and then increments the
operand.
EXAMPLE 1:
Evaluate the expression when a=4
b=a- ++a
=a – 5
=5-5
=0
CONDITIONAL OPERATORS
Syntax:
exp1 ? exp2 : exp3
Where exp1,exp2 and exp3 are expressions
Working of the ? Operator:
Exp1 is evaluated first, if it is nonzero(1/true) then the expression2
is evaluated and this becomes the value of the expression,
If exp1 is false(0/zero) exp3 is evaluated and its value becomes
the value of the expression
Ex: m=2;
n=3
r=(m>n) ? m : n;
BITWISE OPERATORS
These operators allow manipulation of data at the
bit level.
Operator Meaning
& Bitwise AND
| Bitwise OR
^ Bitwise exclusive OR
<< Shift left
>> Shift right
SPECIAL OPERATORS
1. Comma operator ( ,)
2. sizeof operator – sizeof( )
3. Pointer operators – ( & and *)
4. Member selection operators – ( . and -
>)
ARITHMETIC EXPRESSIONS
Algebraic expression C expression
axb-c a*b-c
(m+n)(x+y) (m+n)*(x+y)
a*b/c
3x2+2x+1 3*x*x+2*x+1
a/b
S=(a+b+c)/2
c
ab
b
a
2
cba S=
ARITHMETIC EXPRESSIONS
Algebraic expression C expression
area= area=sqrt(s*(s-a)*(s-b)*(s-c))
sin(b/sqrt(a*a+b*b))
tow1=sqrt((rowx-rowy)/2+tow*x*y*y)
tow1=sqrt(pow ((rowx–rowy)/2,2)+tow*x*y*y)
y=(alpha+beta)/sin(theta*3.1416/180)+abs(x)
))()(( csbsass 
Sin








 22
ba
b
2
1
2
xy
yx


 





 

2
2
1
2
xy
yx


 





 

xy 




sin
THANK YOU
Ad

Recommended

Spr ch-02
Spr ch-02
Vasim Pathan
 
Spr ch-05-compilers
Spr ch-05-compilers
Vasim Pathan
 
Introduction to Computer and Programming - Lecture 03
Introduction to Computer and Programming - Lecture 03
hassaanciit
 
Compiler Design Introduction
Compiler Design Introduction
Richa Sharma
 
Digital Logic Design Lecture 01
Digital Logic Design Lecture 01
shahzad ali
 
Compiler1
Compiler1
Natish Kumar
 
Unit 1 psp
Unit 1 psp
Karthi Vel
 
Compiler Construction
Compiler Construction
Sarmad Ali
 
Compiler lecture 03
Compiler lecture 03
University of Chitral
 
The Phases of a Compiler
The Phases of a Compiler
Radhika Talaviya
 
Unit 1 cd
Unit 1 cd
codereplugd
 
Phases of Compiler
Phases of Compiler
Tanzeela_Hussain
 
Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)
guest251d9a
 
Compiler Design
Compiler Design
Dr. Jaydeep Patil
 
Cpcs302 1
Cpcs302 1
guest5de1a5
 
Compiler Design(Nanthu)
Compiler Design(Nanthu)
guest91cc85
 
Cs6660 compiler design
Cs6660 compiler design
hari2010
 
what is compiler and five phases of compiler
what is compiler and five phases of compiler
adilmehmood93
 
System Programing Unit 1
System Programing Unit 1
Manoj Patil
 
Compiler designs presentation final
Compiler designs presentation final
ilias ahmed
 
Techniques & applications of Compiler
Techniques & applications of Compiler
Preethi AKNR
 
Phases of compiler
Phases of compiler
Karan Deopura
 
Part II: Assembly Fundamentals
Part II: Assembly Fundamentals
Ahmed M. Abed
 
Design of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
Different phases of a compiler
Different phases of a compiler
Sumit Sinha
 
Compiler Design Material
Compiler Design Material
Dr. C.V. Suresh Babu
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
Mukesh Tekwani
 
Error detection recovery
Error detection recovery
Tech_MX
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
Zubayer Farazi
 

More Related Content

What's hot (20)

Compiler lecture 03
Compiler lecture 03
University of Chitral
 
The Phases of a Compiler
The Phases of a Compiler
Radhika Talaviya
 
Unit 1 cd
Unit 1 cd
codereplugd
 
Phases of Compiler
Phases of Compiler
Tanzeela_Hussain
 
Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)
guest251d9a
 
Compiler Design
Compiler Design
Dr. Jaydeep Patil
 
Cpcs302 1
Cpcs302 1
guest5de1a5
 
Compiler Design(Nanthu)
Compiler Design(Nanthu)
guest91cc85
 
Cs6660 compiler design
Cs6660 compiler design
hari2010
 
what is compiler and five phases of compiler
what is compiler and five phases of compiler
adilmehmood93
 
System Programing Unit 1
System Programing Unit 1
Manoj Patil
 
Compiler designs presentation final
Compiler designs presentation final
ilias ahmed
 
Techniques & applications of Compiler
Techniques & applications of Compiler
Preethi AKNR
 
Phases of compiler
Phases of compiler
Karan Deopura
 
Part II: Assembly Fundamentals
Part II: Assembly Fundamentals
Ahmed M. Abed
 
Design of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
Different phases of a compiler
Different phases of a compiler
Sumit Sinha
 
Compiler Design Material
Compiler Design Material
Dr. C.V. Suresh Babu
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
Mukesh Tekwani
 
Error detection recovery
Error detection recovery
Tech_MX
 
Compiler Design(NANTHU NOTES)
Compiler Design(NANTHU NOTES)
guest251d9a
 
Compiler Design(Nanthu)
Compiler Design(Nanthu)
guest91cc85
 
Cs6660 compiler design
Cs6660 compiler design
hari2010
 
what is compiler and five phases of compiler
what is compiler and five phases of compiler
adilmehmood93
 
System Programing Unit 1
System Programing Unit 1
Manoj Patil
 
Compiler designs presentation final
Compiler designs presentation final
ilias ahmed
 
Techniques & applications of Compiler
Techniques & applications of Compiler
Preethi AKNR
 
Part II: Assembly Fundamentals
Part II: Assembly Fundamentals
Ahmed M. Abed
 
Different phases of a compiler
Different phases of a compiler
Sumit Sinha
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
Mukesh Tekwani
 
Error detection recovery
Error detection recovery
Tech_MX
 

Similar to Computer programming and utilization (20)

Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
Zubayer Farazi
 
Cp module 2
Cp module 2
Amarjith C K
 
C progrmming
C progrmming
Shivam Singhal
 
6272 cnote
6272 cnote
P Kiran Sree
 
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
yatakonakiran2
 
1.0 Introduction to C programming for all first year courses.pptx
1.0 Introduction to C programming for all first year courses.pptx
javed Pendhari
 
Problem Solving Techniques
Problem Solving Techniques
valarpink
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
basics of c programming for naiver.pptx
basics of c programming for naiver.pptx
ssuser96ba7e1
 
c_programming.pdf
c_programming.pdf
Home
 
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
bayazidalom983
 
C programming
C programming
DipjualGiri1
 
c programming session 1.pptx
c programming session 1.pptx
RSathyaPriyaCSEKIOT
 
Full Basic Programming in c material ppt
Full Basic Programming in c material ppt
Rajendra400540
 
Introduction to C Programming - I
Introduction to C Programming - I
vampugani
 
c-programming
c-programming
Zulhazmi Harith
 
Unit 1 c - all topics
Unit 1 c - all topics
veningstonk
 
Flowcharts and Introduction to computers
Flowcharts and Introduction to computers
ssuser2023c6
 
Flowchart presentation that can be useful
Flowchart presentation that can be useful
ssuser2023c6
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
Zubayer Farazi
 
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
slidenotesece246jun2012-140803084954-phpapp01 (1).ppt
yatakonakiran2
 
1.0 Introduction to C programming for all first year courses.pptx
1.0 Introduction to C programming for all first year courses.pptx
javed Pendhari
 
Problem Solving Techniques
Problem Solving Techniques
valarpink
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
basics of c programming for naiver.pptx
basics of c programming for naiver.pptx
ssuser96ba7e1
 
c_programming.pdf
c_programming.pdf
Home
 
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
bayazidalom983
 
Full Basic Programming in c material ppt
Full Basic Programming in c material ppt
Rajendra400540
 
Introduction to C Programming - I
Introduction to C Programming - I
vampugani
 
Unit 1 c - all topics
Unit 1 c - all topics
veningstonk
 
Flowcharts and Introduction to computers
Flowcharts and Introduction to computers
ssuser2023c6
 
Flowchart presentation that can be useful
Flowchart presentation that can be useful
ssuser2023c6
 
Ad

More from Digvijaysinh Gohil (20)

Hydraulic cranes
Hydraulic cranes
Digvijaysinh Gohil
 
Hydraulic braking systems
Hydraulic braking systems
Digvijaysinh Gohil
 
Human resources management
Human resources management
Digvijaysinh Gohil
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
Digvijaysinh Gohil
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outline
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)
Digvijaysinh Gohil
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
Digvijaysinh Gohil
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
Digvijaysinh Gohil
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
Digvijaysinh Gohil
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
Digvijaysinh Gohil
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
Digvijaysinh Gohil
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
Digvijaysinh Gohil
 
Traits of a good listner (Communication Skills)
Traits of a good listner (Communication Skills)
Digvijaysinh Gohil
 
Techniques of reading (Communication Skills)
Techniques of reading (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (Communication Skills)
Proxemics (Communication Skills)
Digvijaysinh Gohil
 
Proxemics (2) (Communication Skills)
Proxemics (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (Communication Skills)
Paralinguistic (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (2) (Communication Skills)
Paralinguistic (2) (Communication Skills)
Digvijaysinh Gohil
 
Paralinguistic (1) (Communication Skills)
Paralinguistic (1) (Communication Skills)
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline
Organizing a contents &amp; preparing an outline
Digvijaysinh Gohil
 
Organizing a contents &amp; preparing an outline (2)
Organizing a contents &amp; preparing an outline (2)
Digvijaysinh Gohil
 
Kinesics (Communication Skills)
Kinesics (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (3) (Communication Skills)
Kinesics (3) (Communication Skills)
Digvijaysinh Gohil
 
Kinesics (2) (Communication Skills)
Kinesics (2) (Communication Skills)
Digvijaysinh Gohil
 
Introduction to communication (Communication Skills)
Introduction to communication (Communication Skills)
Digvijaysinh Gohil
 
Email etiquette (Communication Skills)
Email etiquette (Communication Skills)
Digvijaysinh Gohil
 
Welded joints (machine design & industrial drafting )
Welded joints (machine design & industrial drafting )
Digvijaysinh Gohil
 
Types of stresses and theories of failure (machine design & industrial drafti...
Types of stresses and theories of failure (machine design & industrial drafti...
Digvijaysinh Gohil
 
Treaded joint (machine design & industrial drafting )
Treaded joint (machine design & industrial drafting )
Digvijaysinh Gohil
 
Ad

Recently uploaded (20)

Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
 
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
Structured Programming with C++ :: Kjell Backman
Structured Programming with C++ :: Kjell Backman
Shabista Imam
 
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
 
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
 
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
 
Introduction to Python Programming Language
Introduction to Python Programming Language
merlinjohnsy
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
NEW Strengthened Senior High School Gen Math.pptx
NEW Strengthened Senior High School Gen Math.pptx
DaryllWhere
 
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
 
Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
 
AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
Comparison of Flexible and Rigid Pavements in Bangladesh
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
輪読会資料_Miipher and Miipher2 .
輪読会資料_Miipher and Miipher2 .
NABLAS株式会社
 
Introduction to sensing and Week-1.pptx
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
 
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
Structured Programming with C++ :: Kjell Backman
Structured Programming with C++ :: Kjell Backman
Shabista Imam
 
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
Deep Learning for Image Processing on 16 June 2025 MITS.pptx
resming1
 
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
Structural Wonderers_new and ancient.pptx
Structural Wonderers_new and ancient.pptx
nikopapa113
 
Complete guidance book of Asp.Net Web API
Complete guidance book of Asp.Net Web API
Shabista Imam
 
Introduction to Python Programming Language
Introduction to Python Programming Language
merlinjohnsy
 
Industry 4.o the fourth revolutionWeek-2.pptx
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
NEW Strengthened Senior High School Gen Math.pptx
NEW Strengthened Senior High School Gen Math.pptx
DaryllWhere
 
System design handwritten notes guidance
System design handwritten notes guidance
Shabista Imam
 
Industrial internet of things IOT Week-3.pptx
Industrial internet of things IOT Week-3.pptx
KNaveenKumarECE
 
AI_Presentation (1). Artificial intelligence
AI_Presentation (1). Artificial intelligence
RoselynKaur8thD34
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
Comparison of Flexible and Rigid Pavements in Bangladesh
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
輪読会資料_Miipher and Miipher2 .
輪読会資料_Miipher and Miipher2 .
NABLAS株式会社
 

Computer programming and utilization

  • 1. SHROFF S R ROTARY INSTITUTE OF CHEMICAL TECHNOLOGY COMPUTER PROGRAMMING AND UTILIZATION ME SECOND SEMESTER PREPARED BY: NAVED FRUITWALA (150990119006) UTKARSH GANDHI (150990119007) DIGVIJAYSINH GOHIL (150990119008)
  • 2. TOPIC: ALGORITHMS, FLOW CHARTS, HARDWARE, SOFTWARE, STRUCTURE OF C PROGRAM , C TOKENS.
  • 3. ALGORITHMS: • An algorithm is the finite set of sequential instructions to accomplish a task where instructions are written in natural languages like English. It is also called as a step by step solution of the problem. • Space complexity specifies the amount of memory space required by the algorithm for performing the desired task.
  • 4. PROPERTIES/CHARACTERISTIC S OF THE ALGORITHM: • Algorithm has four properties, that are finiteness, definiteness, effectiveness, input and output. They are explained below. • Finiteness: Total number of steps used in algorithm should be finite. • Definiteness: Each step of algorithm must be clear and unambiguous. • Effectiveness: Every step must be basic and essential. • Input & Output: The algorithm must accept zero or more input and must produce at least one output.
  • 5. ADVANTAGES: • Very easy to write. • Easy technique to understand topic. • Easy identification of the mistakes by non computer person. Disadvantages: • Time consuming. • Difficult to show branching and looping. • Big tasks are difficult to put in algorithm.
  • 6. EXAMPLES: 1) Write an algorithm to calculate area of rectangle. • Algorithm: Step 1: Accept the value of length i.e. L Step 2: Accept the value of breadth i.e. B Step 3:Calculate area i.e. A=L*B Step 4: Print Area i.e. Print A Step 5: Stop procedure
  • 7. FLOWCHARTS: • A flowchart can be define as the pictorial representation of a process which describes the sequence and flow of control and information within the process. • The various symbols used in a flowchart.
  • 8. Symbol Name Uses Start and stop symbols Used to start flow chart as well as to terminate the flow chart. Input / Output Used for IO operation Process Used to mention ALU and data transfer task(i.e. Arithmetic or assignment start stop
  • 9. Yes/true Decision For branching condition Flow lines Indicates flow Loop Indicates finite loop Connectors Connecting flow lines from different places Tes t ? no/ fals e initializ ation Next A A
  • 10. Multiple section For multiple branching condition Block Indicates block of statements or body of loop Module call Calling the subroutine or function Test ?
  • 11. ADVANTAGES : • Easy to draw. • Easy technique to understand logic. • Easy to identify the mistakes by non computer person. • Easy for branching and looping. Disadvantages : • Time consuming. • Difficult for modification. • Difficult task to draw flow charts for big problems.
  • 12. EXAMPLES : 1) Draw a flow chart to find the average of marks obtained by a student in three subjects. • Flow chart : start Read marks 1,2,3 Avg= marks (1+2+3)/3 Print avg stop
  • 13. HARDWARE• Hardware is the physical components which are touchable and sensible. It is mainly divided into 4 parts-CPU, input device, output device and auxiliary memory. • CPU is the Central Processing Unit which contain electronics circuit and used to execute instructions and also controls the operation of other input
  • 14. HARDWARE • CPU accepts information from user through input device. There are many input devices like keyboard, mouse, microphone, tracker balls, touch screens. • CPU conveys information to user through output devices. There are many output devices like monitor, LCD, printers, plotters, speaker. • Auxiliary memory is also called as a secondary memory or external memory or magnetic memory. This is permanent memory. User can store data
  • 18. COMPUTER SOFTWARE PROGRAM IS THE COLLECTION OF INSTRUCTIONS, WHICH PERFORMS PARTICULAR TASK, AND COLLECTION OF PROGRAMS WHICH ACCOMPLISHES APPLICATION (THAT MEANS NUMBER OF TASKS) IS CALLED AS A SOFTWARE. THIS SOFTWARE IS CLASSIFIED INTO TWO CATEGORIES - SYSTEM SOFTWARE AND APPLICATION SOFTWARE. SYSTEM SOFTWARE DIRECTLY INTERACTS WITH COMPUTER HARDWARE, WHEREAS APPLICATION SOFTWARE IS ONLY DESIGNED TO SOLVE USER PROBLEMS AS PER USERS REQUIREMENT. TYPES OF SOFTWARE :- (1) SYSTEM SOFTWARE (2)APPLICATION SOFTWARE
  • 19. System Software System software is classified into 3 categories: (1) Operating System (2)system support software and (3) system development software • Operating system manages hardware as well as interacts with user‚ and provides different services to users. There are many operating systems like DOS, Windows-XP,VISTA‚ LINUX etc. • System support software manages hardware more efficiently. for example drivers of the IO devices or antivirus software. • System development software supports programming development environment to user. It include editor, pre-processors, compiler, interpreter, loader etc.
  • 20. • Editor is the software ‚ which is used to create programs as well as it is used for modification of existing programs. • Pre-processor is the software which is used before translators (that means compiler or editors) , which is used to replace some segments of code With some another segment. It is also called as an expansion. • Compilers are the software which can translate high level programs into low level programs. • Interpreters are the software which can translate line by line high level programs into low level programs • Loaders are the software which can load object codes into the main memory and execute it.
  • 21. APPLICATION SOFTWARE • Application software is classified into two categories : General purpose Software and Special purpose software. • General purpose software is used for many number of tasks, and provides many features for example word processor, oracle, excel etc. • Special purpose software is designed for Specific purposes only. User programs comes under special purpose software for example pay roll system for specific
  • 22. STRUCTURE OF C PROGRAM Documentation Section /*It tells purpose of C programs, author name and etc */ //Program to add 2 nos Link Section #include<stdio.h> Definition Section #define PI 3.1414 cont…….
  • 23. Global Declaration Section Main() function Section main() { Variable declaration/Initialization Section; Program statements or Executable Section; } Subprogram Section Function1() { Variable declaration/Initialization Section; Program statements or Executable Section; } Function2() {}
  • 24. • Documentation section consists of comments. Comments are not executed by the compiler. Single line comments start with // symbol and multiple line comments are written within /* and */. • Link section consists of pre-processor directives which link the compiler to the standard library functions. We include different predefined standard library functions in our C programs.
  • 25. #include <stdio.h> is a header file that consists of standard input/output functions like pritnf(), scanf() etc. #include<math.h> consists of different math functions like sqrt(), log() etc. #include<graphics.h> consists of different graphical functions.
  • 26. • Definition section defines all symbolic constants like #define PI 3.14. • Global declaration section declares the global variables. These variables can be used in more than one functions. • main() function is the special and important function used by C programs to tell the compiler where the program starts. Every program must have exactly one main() function. • The opening { and closing braces } indicate the begin and end of the main() function. • Subprogram section contains all user defined functions that are called in main() functions.
  • 27. C TOKENS :- •Smallest individual units in a program are known as Tokens. The compiler recognizes them for building up expressions and statements.
  • 28. 1. KEYWORDS :- • C language has 32 reversed keywords. • Since keywords have specific meaning, we cannot use them as identifiers. • All keywords are to be written in lower-case letters. • C keywords :- auto extern sizeof break static case for struct char goto float switch if int etc…
  • 29. 2. IDENTIFIERS :- • Alphabets, digits, underscores are permitted. • They must not begin with a digit. • First character must be a letter. • Uppercase and lower case letters are distinct. • VALID INVALID A 4abc Roll_no Roll-no num2 num-2
  • 30. 3. CONSTANTS :- • Constants are the identifier that represent fixed values. • First type is String Character & Literals :- • Second type is Numeric constants :- a.) Integer constant 1.) Octal constant 2.) Hex constant 3.) Decimal constant b.) Floating point constant
  • 32. 5. OPERATORS :- • It is a symbol that takes one or more operands (variables, expressions or values) and operates on them to give an output. • There are many types of operators :- 1.)Arithmetic 2.)Relational 3.)Logical 4.)Bitwise 5.)Assignment 6.)Unary 7.)Conditional 8.)Special operator
  • 33. DEFINITION “An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and variables” Ex: a+b
  • 34. OPERATORS IN C 1. Arithmetic operators 2. Relational operators 3. Logical operators 4. Assignment operators 5. Increment and decrement operators 6. Conditional operators 7. Bitwise operators 8. Special operators
  • 35. ARITHMETIC OPERATORS Operator example Meaning + a + b Addition –unary - a – b Subtraction- unary * a * b Multiplication / a / b Division % a % b Modulo division- remainder
  • 36. EXAMPLE 1 X = 9-12/3+3*2-1 = 9-4+6-1 =10
  • 37. RELATIONAL OPERATORS Operator Meaning < Is less than <= Is less than or equal to > Is greater than >= Is greater than or equal to == Equal to != Not equal to
  • 38. Logical Operators Operator Meaning && Logical AND || Logical OR ! Logical NOT Logical expression or a compound relational expression- An expression that combines two or more relational expressions . Ex: if (a==b && b==c)
  • 39. TRUTH TABLE a b Value of the expression a && b a || b 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1
  • 40. ASSIGNMENT OPERATORS Syntax: v op = exp; Where v = variable, op = shorthand assignment operator exp = expression Ex: x=x+3 x+=3
  • 41. SHORTHAND ASSIGNMENT OPERATORS Simple assignment operator Shorthand operator a = a+1 a + =1 a = a-1 a - =1 a = a* (m+n) a * = m+n a = a / (m+n) a / = m+n a = a %b a %=b
  • 42. INCREMENT & DECREMENT OPERATORS C supports 2 useful operators namely 1. Increment ++ operators 2. Decrement -- operators The ++ operator adds a value 1 to the operand The – operator subtracts 1 from the operand ++a or a++ --a or a--
  • 43. RULES FOR ++ & -- OPERATORS 1. These require variables as their operands 2. When postfix either ++ or – is used with the variable in a given expression, the expression is evaluated first and then it is incremented or decremented by one 3. When prefix either ++ or – is used with the variable in a given expression, it is incremented or decremented by one first and then the expression is evaluated with the new value
  • 44. EXAMPLES FOR ++ & -- OPERATORS Let the value of a =5 and b=++a then a = b =6 Let the value of a = 5 and b=a++ then a =5 but b=6 i.e.: 1. A prefix operator first adds 1 to the operand and then the result is assigned to the variable on the left 2. A postfix operator first assigns the value to the variable on left and then increments the operand.
  • 45. EXAMPLE 1: Evaluate the expression when a=4 b=a- ++a =a – 5 =5-5 =0
  • 46. CONDITIONAL OPERATORS Syntax: exp1 ? exp2 : exp3 Where exp1,exp2 and exp3 are expressions Working of the ? Operator: Exp1 is evaluated first, if it is nonzero(1/true) then the expression2 is evaluated and this becomes the value of the expression, If exp1 is false(0/zero) exp3 is evaluated and its value becomes the value of the expression Ex: m=2; n=3 r=(m>n) ? m : n;
  • 47. BITWISE OPERATORS These operators allow manipulation of data at the bit level. Operator Meaning & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR << Shift left >> Shift right
  • 48. SPECIAL OPERATORS 1. Comma operator ( ,) 2. sizeof operator – sizeof( ) 3. Pointer operators – ( & and *) 4. Member selection operators – ( . and - >)
  • 49. ARITHMETIC EXPRESSIONS Algebraic expression C expression axb-c a*b-c (m+n)(x+y) (m+n)*(x+y) a*b/c 3x2+2x+1 3*x*x+2*x+1 a/b S=(a+b+c)/2 c ab b a 2 cba S=
  • 50. ARITHMETIC EXPRESSIONS Algebraic expression C expression area= area=sqrt(s*(s-a)*(s-b)*(s-c)) sin(b/sqrt(a*a+b*b)) tow1=sqrt((rowx-rowy)/2+tow*x*y*y) tow1=sqrt(pow ((rowx–rowy)/2,2)+tow*x*y*y) y=(alpha+beta)/sin(theta*3.1416/180)+abs(x) ))()(( csbsass  Sin          22 ba b 2 1 2 xy yx             2 2 1 2 xy yx             xy      sin