ALGORITHEM
🌝
algo is a step by step process to perform any task . it is the
logic of program .
it is a sequence of instruction basicly written in
English language .
Algorithm 0.
A SIMPLE OR EASY
trick how to we write
an algorithm
step A:- start
step B:- input or read variable
step C:-using formulas or condition
step D:- print value of condition
step E:-stop
👇👇👇 FOR EXAMPLE 👇👇👇
#algorithem 1.
Addition of two no.
step 1:- start
step 2 :- read 1st no. to store it in a variable
step 3 :- read second no. to store it in a second variable
step 4 :- c <--- a+b
step 5 :- print c
step 6 :- stop
#Algorithm 2.
average of two no.
step 1:- start
step 2:- read three no. ( a,b,c )
step 3:- sum<- a+b+c
step 4:- x<-- sum/3
step 5;- print x
step 6:- stop
#Algorithm 3.
check input no. is odd or
even
step 1:- start
step 2:- input no. ( X )
step 3:- if X mod 2==0 then
step 4:- print ( "no. is even ")
step 5:- else
step 6:- print ( "no. is odd " )
step 7:- stop
0 comments:
Post a Comment