4122 Assignment 4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

HSS HHLNT 4

LALIT CAAUDHARY
4122

TiruE: To hek uwhethot he giuen numb in AmstAng num bey


thute degaee
Or not. An admulHong numbeu u an inttgeH with
a s digitt s Aquad tb he numbe
Auth that the sum d cubes

tse
ond
OBTECTIUE: Undeusond bakic nept o pHoRHammin q onguaqe
st mothemahal (alulahns in þuoquaming appuoach
Hyo Ale bu
ond quahun
wth the hdb o oxmul as

PRoBLER STArE HELT : To Houe thad giuen 9gt s On gumsluon

numbe
ond this iaample, we Ahould haue the
THEOPY: To unde
Pythn RAoqHammin mueph ith bauic
knouüledg e o) jloubing

i dte ttatment
ythom
Python whle alemenB loop.

Oha aAr i de atalerneot in byhon?


u Deisim Making eqjuuHed hen we wan o eut a code

only ia cotain tgndihan Ahd.he i di) due gtakment


u ued in byhon ur deuson uodtAol
Phan &aement Agntax

stukment (&)
Hue Ahe puoguam euaduabet the tut zpueUAon ond uwill xecutt

StulemenF anly u t x þuestim Hur.

I Hst rHaion js lale, she Atalement not ikecuted.

I n ythanm, the body s) halement a inditatd by indem chn


Bady Atu1s isith an indentahon ond s uninknttd ihe make

h e ind.

uthon ouchau

expression

True
False
Booy

thon s stademen Rkample


num3

num >d:
numbo
pHint num" a o osifue
This adusays kainttd")
bAint
n u m : - 1

inum > 0.

u & þosihue num.


bHinnum,
I n tale baums\JHong numbeu o 3 diqt, Ahe Aum o rube o
ach dqts a qua b the numbo shel

Kumble
153 sa 125 - 153
We nctd v adulalt he aum (ubel o Ach dnt.So e nialte
the aum hb 31o and obBain each dyt by uing moduduu thtanr 7
Remaind u the numbeu Lohen dividtd hy 10 e s he kGA
dit he numbu
ALGAORITH
Read an inpuk numbe uAing input ).
Che uuhetheu he valuue untted an nRqe or not
Check inpul.num u qealu then o
Intialige a yaHiable named aum.num do

f n d semoinde a he inut num bor by Ai 7 opu arsr b ge


Loch diq inte numbe
Once digt by leting a= num, 1o
Tens digt by b:num . 10 -alo
UDus tube iadh drgt and add st aum-num
(3 1oput.num Luas ho GHM-num, puin t UM S ANHSTRONIG
"

( inpt-nurm J ngt gua Jo aHm.num kiint Non is Dor

AXHrROWG.

(ON CLUSioN: hus e lomec and hudr ed aHmtHong ns.


LOnLupt in pyhn duLUsJully

You might also like