(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
SR ROTARY INSTITUTE COMPUTER PROGRAMMING TOPICS
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)
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
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
15.
16.
17.
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
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
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.
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 -
>)