C++ Notes for class 11
Notes-
Programing-
programing is a method which is help to create the software it is als
o interface between user and machine.
It is a set of instruction.
Program solving technique
there are mainly two type of technique used in programing to solve the program.
1. Algorithm
2. Flowchart
Algorithm-
An Algorithm is a finite set of step of step which is required to solve given problem.
In other word the meaning of an algorithm is a step of step by step precise method which is formulated for solving a problem by a computer.
Properties of an Algorithm-
Finiteness-
An algorithm should contain a finite number of step, each of which may required one or more operation.
Definiteness-
Each operation within an algorithm must be definite meaning i.e. if should be perfectly clear. For example, 5/0 and add 6 or 7 to x are not permitted because it is not got the result of the operation.
Effectiveness-
Each operation in an algorithm must be effective that is each step must be such that it can be carried out manual by a person with paper and pencil in a finite amount of time.
An algorithm will expect zero or one input and produce or more output.
An algorithm should terminate after finite number of step.
Example-
/* sum of two number */
Step 1: Start
Step 2: (initialization) a=7, b=3, c=0
Step 3: c=a+b
Step 4: Print c
Step 5: Stop
/*Swapping of two number */
Step 1: Start
Step 2: (initialization) a=8, b=2, c=0
Step 3: c=a, a=b, b=c
Step 4: Print a, b
Step 5: Stop
/*Find largest and smallest between two number */
Step 1: Start
Step 2: (initialization) a=7, b=8
Step 3: is(a < b)
then print a is large else print b is large
Step 4: Stop
/*Check the given number is even is odd*/
Step 1: Start
Step 2: (initialization) a=6
Step 3: (a%2==0)
print a is even else print a is odd
Step 5: Stop
/* Area of circle */
Step 1: Start
Step 2: (initialization) r=10, a=0
Step 3: a=(ЁЭЪ╖r²)
Step 4: Print a
Step 5: Stop
Notes-
Programing-
programing is a method which is help to create the software it is als
o interface between user and machine.
It is a set of instruction.
Program solving technique
there are mainly two type of technique used in programing to solve the program.
1. Algorithm
2. Flowchart
Algorithm-
An Algorithm is a finite set of step of step which is required to solve given problem.
In other word the meaning of an algorithm is a step of step by step precise method which is formulated for solving a problem by a computer.
Properties of an Algorithm-
Finiteness-
An algorithm should contain a finite number of step, each of which may required one or more operation.
Definiteness-
Each operation within an algorithm must be definite meaning i.e. if should be perfectly clear. For example, 5/0 and add 6 or 7 to x are not permitted because it is not got the result of the operation.
Effectiveness-
Each operation in an algorithm must be effective that is each step must be such that it can be carried out manual by a person with paper and pencil in a finite amount of time.
An algorithm will expect zero or one input and produce or more output.
An algorithm should terminate after finite number of step.
Example-
/* sum of two number */
Step 1: Start
Step 2: (initialization) a=7, b=3, c=0
Step 3: c=a+b
Step 4: Print c
Step 5: Stop
/*Swapping of two number */
Step 1: Start
Step 2: (initialization) a=8, b=2, c=0
Step 3: c=a, a=b, b=c
Step 4: Print a, b
Step 5: Stop
/*Find largest and smallest between two number */
Step 1: Start
Step 2: (initialization) a=7, b=8
Step 3: is(a < b)
then print a is large else print b is large
Step 4: Stop
/*Check the given number is even is odd*/
Step 1: Start
Step 2: (initialization) a=6
Step 3: (a%2==0)
print a is even else print a is odd
Step 5: Stop
/* Area of circle */
Step 1: Start
Step 2: (initialization) r=10, a=0
Step 3: a=(ЁЭЪ╖r²)
Step 4: Print a
Step 5: Stop
Comments
Post a Comment