classmate
B2LO!/2023 Qr—0
|
os] t_process to solve _o. bro blem.
~— |euppose thot we ane given A2numbern 2we
ak ve weturn ther sum- This se On example
| Understand the problem. We need te know
lwhat is given & whak we fave to find
Checking the f/p vobos
Aftex Rno ing the (/b values and also What
we need to find 5 we need to And Hh abbyoach.
He solve that baubculass problems
[Problem --— Solution fn owe mrncl
A& the end we have tp mate the Computer
Solve the problem. After we have the soluhon
fn Cunwiind , just make o rough soluhon-This
Prough Solution can be In form ot flowchaxt
bx _pseido code.
al
Algorithm Stebs +o solve the broblem+ This is
bari catty the Step-by-Step procedine to
Solve a y iS *
|
St [s_fmpoxtank Ip note thak this rough sol”
§ not undenstood by the combiter & hence we _
Fa haven n b
Undinstand only binaxy longlage, (-¢ rachime —
Wander standable Language
High deve come Bcompulen can.
understand this,
een)
vuaiicu wiur vam”
classmata
Date_
Page —~)
Humans wilt not use the machine language & ~
Ihence_we use high fevel Language which wilt be
____||convexked to machine undenstandable forma.
|Combilex wi Rt do the above conversion.
Ustng cornputex. to Solve a broblem
Why to use _conmbutex to solve the problem?
uppose we have +p check that I3 15a pxume
[number Hem by | =o
n=13
nem by |3=0
\Brem2 =
}
13vem 3 = | | Tis isaacthelibn task:
I3rem [al J
The above thing ca done for smelt
Rumbers but it wil be a cumbexsome task for
lus to calustat, whethex a number i's prime
os not for numbers Which ae big + Hence this
tLaskk. Wii be done by the computer
Note= || Problem —> Algorttam ——> Sol”. within
L 2min at max. 7
Bil game Wes
‘ how.
Flowchawt 7
Te ts the graphical yebresentahien an
ne .
oGoues op ekebs)
vuaiicu wiur vamclassmate,
Wm bols -
~_ [some symbols i a
[he_procens ef, drawing a flowchaxt for an_algorvithm
is prown as Flow hastting «
~Icomponents ef, flowchare
| Temnator
___[Tndwcates the starting and ending state
= ok g-State ef the
i CStask_) (end)
= —<——
Representation
2 |Tput foukbur To either take I/p value ov te
Give olp on the screen
i Read a [Print a. |
~~
_Rebresentation. 7
2) Process blocks This is usec erthen for nikal 3ahon _
lor the caleutahon Port fnihaligation > calculahion
ft=o
i (Sense)
Decision making block Thew wilt be a condthon
KR babed on truth vole » the civec
Algorithm IS decided.
Are, No. [Print Hy
4
7
ze [Ye
Prine |
— Hello |
athe olp wild be He
xs]
fhe poctim
a _
CTI TST WITT CMclas
Page ~~
SS
|___§) || Connector This is fox Sunchon_4_w iMbe
|__Idiscusseak after clays ef, funchion
SA ts function name
Pseudocade. a
Pseudo means false - We don’t have. ent
1 ror
Sum =A+b
Print sum
|Eed program.
|| ote Thou can be mutible ays SL, waihag
|. pseudocode
| €x- Dr 2 pe 7
[Read O&b ! Read a ' Read a
Diff = a-b ' Read b v Read &
Print Disf | DifS=O-b Print re
Print: Disp | ~
xa Mud “eb
Read _o 2b —
Prod = a b
Print Prod
vvuaimicu wiur vamae
“Gx Print overage 4 2 numbew
— [Reed a & b
a 1b
Jovy = oe )
—|Print_avg
TI 7
—|Prachte questions
be]
“pl Add 2 numbers by taking input
s Gears) Read a Ab
a sum = atb
— aab/ Print Sum 7
JSurn =a+h]
L us
Print sum
q 7
(Cena)
2)| Find civcum ference of circle
(Stone) Read x.
L ciy = 2*34y*y
Read 3] | Prink cir
J
(oe! ama
[cheamfoene_=
4
[Prin circumfecente /
(ena)
vvuaiicu wiur vamclissnate
3) Average 6}, 3 number.
(Stars)
L
Read a ay
avg = (A+b+c)
eH)
[Read as &¢ |
JL
Print avg
[avg = Ca+b+c) 13]
[Print avg ] ms
L
(nd) 7
avd
Check {$ numben Is odd ov even
Nvem Q2=0 > even 7
Rrema#O aodd
Henn we use % obenalnr te find the remander-_
Gas)
J
[Reet n]
=
Yer, /Prink even}
No
[Peink odd [— (ena)
induces equal te & not arstgnment obnar
RLREDO means whether when n divided
a
© or not:
*f > modulo Oberatny
.
vvuaiicu wiur vam~~ |pacernahive
NN
el Ss ~S [Peint cide)
SF LNo
sl Print ever |
as nz2==l, “this meank odd numbers
_ TA7QR= | hence 71s odd number
~___||Feeudocede
*i|Read on
§ n*2Q2==! s then print odd
else print even
*||_ Read nr _
if nvX==0, then print even
else brint Odd
5) Student 4 grade flowchaxt
Mmayks >= Go A
maxbs > =80 38 i
i Maxtks 7 =60 3 C
i ments >= 407 D
_ manks
F
- Pseudo code.
- Read maxks
If mayps?=Jo , print A
else 1 manbs 7= 80» print B
lelse 1 tanbs >=605 print C
lelse If manks? = Yo pxint D
else 1 mans <4oO 9 print F jelse putnk F
ovaiicu wiul vaintox)
[Read 7m. I
(mp2 Yes > [Prink Ph a
[ve | —
fm Yes Poink ZH a
i | :
>, Ye [Petre CH
No - - 3
im, Yes, [Prine Hy iy a te
4o
Asifa [Ye
numbers 1 7
veater © [Print FL —£ena)
alse not equal, th means that numbes willbe
pbviously Lessen than 40. a”
Check number is +ve ,-ve or 0 —
Read _
if N7O_ byink bositive __y
else 1f n=0 prink zexo a
lelse print negative: |
no need Fo check as IF It is not posinve &_
Also pot Zeno ,then it will be Negative, |classmate.
= (Stas)
—_ L
| Read nr /
_-
L 7
I R25 YO , /Prink positive
[No
hed Ye . [Print zexo
LNo J
. 7 (end
Prfnt Negative > (end
Dry yun .
Is 1s oO bun
& then Movin hank to check,
Wwhebhen Oux 0g ovithm Is “running fine ow
nok:
QI Muthbly 2 number by taking Mnpub
Hw?
GCeaxd) Read_o 2k
LU mul = Ax b
[Read a & b] Print put
Jb
[mut =a * b]
| Lb
[Print mut ]
Lb
— Gnd)
vuaiicu wiur vaMClbssmat,
Readabte (stant)
Peatbtc
Print P Read a5 b ze] —.
J _
[P=a+b+c]
L
[Print P|
J :
(end) =
Siynple_finkeest =
Read P,RAT (Stank) _
ISI =(PAR*T) J
100 Read Py R& Tl
Print ST J
[sz=* R*T)/io0]
i
JU
i [Print ST]
L
(end)
| Pring counting from | +e n.
Geared) i+ Read in
Coe S
Read n/ Bf (on
: exit
= 4. else print ¢
t=]
Looping t -S4 Goa) gre s
concept Vo
u
[exes | Rink t
is
vuaiicu wiur vam< s 2)
Here we have used the concept oh, Looping.
| Print counting from nite to
a
Te GS tosck) 1s Read n_
~ v 22403
a Read rn] 3: Ff C