ALGORITHM
Hello, students today I am very happy to write this article. and I hope that you have understood very well. because I have written all the things very clearly. in this chapter, I will discuss everything about this concept of c++ programming. after studying this you acquire lots of knowledge in yourself and you have an idea about how to make the algorithm. so now let's start.
ALGORITHM
π An algorithm is a very popular technique that is used to obtain a solution for a given problem.
πThe step to step development or solve the
problem written in simple language is called an algorithm.
πIn another word finally, we can say that
it is a step by step development of any plan to do something is known as an algorithm.
π It is a paper plan. Which is prepared
with the help of a pen and paper.
π It is used to get proper and better results.
Rules for writing an algorithm:-
π An algorithm must begin with “START”
or “BEGIN” word.
π Each step has a step number except
inside control flow structures i.e. condition or iteration.
πVariable names are generally written
in the uppercase letter.
π Variables are initialized by using “SET”.
π:= is used to assign values to variables.
Example – SET A:=5
πRead, Input, accept is used to take entre from users.
πWrite, display, print, is used to show output.
πComments are written in a square bracket.
πFunction and processor may be used for modularisation.
πAlgorithm end with the "STOP" or "END" word.
1. Q. write an algorithm to find the sum of two numbers.
Ans:-
1-Step - Start
2-Step - set A:=0, B:=0, S:=0
3-Step - Read: A, B
4-Step - S:=A+B
5-Step - print S
6- step – Stop
2. Q. write an algorithm to check the odd or even numbers.
Ans:-
1-step- start
2-step- input: N
3-step-if(N%2==0) then print: " N is an even number" Else Print: "N is an odd Number"
4-step- stop
3. Q. Write an algorithm to check eligibility for a vote or not.
Ans -
1-step- start
2-step- Input:
age
3-step- if (age>=18) then print :"eligible for a vote" Else Print: "not eligible for a vote"
4-step-stop
4. Q Write an algorithm to print your address
Ans -
1-step- start
2-step- print: my name is Vikash Mishra
3-step- print: I live at Garhwa
4-step- print: I read in class MCA
5-step -stop
There
are three-way to represent of Algorithm such as-
1.
As Program
2.
As Flowchart
3.
As Pseudocode
πA
set of instructions or sequences of instructions written in a programming language is called the program which is for computer understanding.
πIt controls
a computer’s process activity and the computer perform precisely what the program wants it to do.
πWhen
a computer is using a program to perform the task it is called program executing.
πTom Kilburn wrote the first software program to hold in electronic memory. it was successfully executed at the University of Manchester England on 21 June 1948. At that time the computer was called the mall Scale Experimental Machine(SSEM). it was known as Manchester Baby. this name is considered as the birth of the software.
πThere
are various types of the program such as:-
1.
Application program
2.
Computer program
3.
Object program
4.
Peripherals interchange program
5.
Source program
6.
System program
7.
Symbolic program
8.
Translating program
hey, someone always confused about what is program and application software. so I decided to clear your doubt difference between program and application software.
Difference between program and application software.
There are the following differences between program and application software such as:-
1. program is the smallest part of the application software. whereas application is a collection of multiple programs.
2. program can not be an application. whereas application software can be a program.
3. program is a collection of instructions that performed a particular task on the computer. whereas application software cannot exist without program and functions to carry out end-user commands.
1. Application Program:- An application program is a comprehensive, self-contained program that performs a particular function directly for the user.
πEmail, Games, Media player..etc are the example of the Application program.
2.Computer program:-it is a collection of instructions that can be executed by a computer to performed a particular on a computer.
π it is usually written by a computer programmer in a programming language.
3. Object program:- A program into which another program. And it is translated by a language processor in a computer.
4. Peripherals interchange program:- it is a utility to transfer files among electronic devices or digital equipment corporations computers.
πit was first implemented on the PDP-6 architecture by Harrison "Dit" Morse early in the 1960s.
Comments
Post a Comment
Hello students
If you have any doubt then let me know.