0% found this document useful (0 votes)
24 views56 pages

C# 1-10

The document describes writing C# programs to demonstrate various arithmetic operators and swap two variable values. It also describes writing a program to print the sizes of different data types in C. The programs are explained with flowcharts and code snippets and the outputs are displayed.

Uploaded by

Sameer Kothare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views56 pages

C# 1-10

The document describes writing C# programs to demonstrate various arithmetic operators and swap two variable values. It also describes writing a program to print the sizes of different data types in C. The programs are explained with flowcharts and code snippets and the outputs are displayed.

Uploaded by

Sameer Kothare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Y.C.C.

E
DATE
Pxqctic al (A)

Aim Wnte Poog oam to


do menst 70tc 4he of ayithmetie operotors .
Aim WYLe demansiete
Flowchart -
Stost C
haoxy
Tatroduct)on
Declare a20b=3 ot oribmetic
-Dnerotors to mathemoticol
Pajot q-L Dpexairs
werk with operande which con be VaYiahle s
Prjnt atb

demaostatlon
theszy
Print a xb
wilting ettectiec aole
ypes of

aperand inaluding
Rinay aperaipa s These tuo apeind a

diwispn /)an edulus C)


Y.C.C.E
DATE:

eloss

stot)c

cessoe witeine Gubst2chien.

console, Wite Line Divisleo


Y.C.C.E
ATE

output
Substvation of 00 ond 3 i5 7
out aut
Substao ctieo
Multiphcot ion of 20 o0J 3 js 30
Diyjs)on ot I0 and g j53.333 2333 Aditjoaof
Mulkiplica tian ef J52.3333
Conclysion - Hence Jwe hove Svcce65 tully
exec vt ed the C psjvum 7D demonslrote We
the VSe ot arithmetic DperatDrs,
exec wte the
demonsthote the
Y.C.C.E
DATE

Proctica) )(B)
Aim - w)te Pegrom Practica) LB)
to swap two
Flowchoxt Am
AVobers
stqrt

Declore a=3| b=5 tem p Theosy


GeVero weye each wth ids
achiey sdL and tde -otfs
/Pojnt betoze swD PPing y91b

temp 9 OM M DO
=b the
Method, yoy declre thid y2riObe store
af thea
the
oyer Wrt e first Dabe
/Priot ottes sw PPin9 191b/ Fioe)y aGBigp the First
G10p ) lhe
the

Gybstiactieo -
4he pInpertie 6
Thic methed
of
the
trom he other
Y.C.C.E
CATE

Paqseo
class Guap
Gtatin

Con sale wniteliae ( Betr Wapping valee

teap
Console, Write liap (it Ater swopping
Volues

output Befne swapping volues are i s,2


Aflex sWgpping yolves ate 3,5 Vo)Me s atei 2 5
Ate Swappng
Conclus)on - Hence ) we hove 5vccesfully
execvted the C progrum to eXecuted
tws ovmber s. to
Y.C.C.E
DATE
Prgctical 0cc)
wr)te
Pogoum to Print Pxgctical glc)
S)ze of differeDt Jota typcs .
Flowcbaxt
pigram to psiot
S02e Jfene0t
Start

Piot s) zeofCjn t) / Theory


usn4 syatem
Print si2evf (Flbo ) foxoeWork alassibyppicatloo
cantaiaing nuoTLIG
types esse Dtial fax develapment
Print cize of l e hor)/ fund ment ) cacses hke objet
stnng ceosole Math , Date Tine and meg more
Priot size of (Joub)e) /
System Io
Print size bf Cbob) 5team
Essentie) ppicotless
StoP. wIite

Gystem, Text - wth text eacoding


and moajputioo
Tades pensl ble doto
cha XLLtex
applicatiess
Y.C.C.E
DATE:

System
Syalumey
yotem, Texti

Aeme spoce Typee


Onss Test

Gi2coflot):
2, 11

S)zepf Lchod
coASele , Wyiteliae (tk sizenf Laube)i fo3 n,
Y.C.C.E
GATE

outp ut - Qutput
6)2eofiot) 4
sj2e of Cint: 4
sizeof (floot) : 4
S) ze of (chor) :2 Gi22 Df lchar) i 2
a)220f Ldevb)e):!
si2eof Cbool) i 2

cOnc)vsinn - Hence 1 we 5ucle ssfully erecuted


eXecyted to pr)nt
S)2e JiffeseDt doto types . iffexeot dota typec
Y.C.C.E
Proctica) 2 LA) DATE

Aim- wiit e a c# pr og rom tot tind Poctical LA)


the yoots quodret/e cquato0.
Aim
Flowehatt - the quadrotie Lquatiaa
stort
Theory
Tf-else
Dec)axe q=0) b=6j c Fb
PuYpose To hyaot hing
exeLte
Print 4Uadrati2 e9uoJbh a1x *Y+bi Xte =6
djfferent bycedon whether a
PrintEnter the yo)uc of A certoia falae
I0put a

/Pzj0t bs Eoter the valuc of 8'T0put b else


/int b Enler the yol ve of cil Ioput c 3

co)) comput eRoot loy byc)


Purposc alculatea the squere

ayatex - double xebnl t =Math Gqri laum hex)y

thot
Y.C.C.E
DATE:

Parsc

Preqreo
uslna yslensj

public Gtatic Dd compute Raet (doublep


deuble b deu hlec)

Joyble
Y.C.C.E
DATE:

Dis tinet 1)
Yoot = (-LtMoth, Sgt leg))a o)

Equal 1);

ceosole . wteae(Rnotsexe

Math, Saxt leg)ho;


Y.C.C.E
DATE:

output i

GMicrosoft Visual Studio Debu X


Quadratic equation a*x*x t b*x + c =0
Enter the value of A: 0
Enter the value of B: 3
Enter the value of C: 4
Not a uadratic equation

G Microsoft Visual Studio Debu X

Quadratic equation a*x*x + b*x + c = 0


Enter the value of A: 12
Enter the value of B: 34
Enter the value of C: 12
Roots are Real and Distinct
Rootl: -.41
Root2:-2.42

MicrOsoft Visual Studio Debu X +

Quadratic equation a*x*X + b*x + c =0


Enter the value of A: 1
Enter the value of B: 4
Enter the value ofC: 4
Roots are Real and Equal
Rootl: -2
Root2:-2
Y.C.C.E
DATE

Conclu5)0 h -
Heoce , we hove hore
executed the c# sucCe6sfully
program to find
Heney we
the Yoo ts of
quodrotic equotien.
Y.C.C.E
DATE:
Practical 3cA)

Pxactical 3CA)
Aim wite
wether oUmbex is po)odyom
check
to check
Aim- wYte cHprgiam jspalindreme
Flowchalt - whe ihex thegives
Stort

Tha axy
PaliodroMe Palindome Duphere
K(Input nUmbey thot retain thely velve when thelr
=Yeerse integers They hold acexdaia
YeYeISed
digits Mathe Maties dye to thelx uniqhe
yes
prepery of Yemaia io4 uacban qed whe o xead
int (6 Giyeo
PiOt 20 Given
A eher Fphples of paliadseme s
numbex is polindauoc Polindeomc These
hold Cultulo) lga)fican ce jo vorlous
60cieties ad often 55pated with

5toP luck foxtuae

To check f a
the OWm be x
you typically xevere
t with they
the the palipdreme
Y.C.C.E
DATE

Progxon.

PalindrpMe

classTest

5tatie vaid Main lstxing LIarg s)


iot
Cansole wrtblin lbb Eote) Num bex 2 21);
iot ParsL lConsele Readline C)

Con soe, witeLiaelkb Givea umker


ic Palin daoma 2?)2
else Consel, wteline bGiven Num ker
isNot Palindome ));
Y.C.C.E
CATE

out put - Enter Number ? 121 Eater


Given Vumbex is polinrom e GiveoWumter

Corclusion - Theyc Hove we have ConclG)b) There fote we


6 UCce Gs fully exec uted the C# PrOg Y9 M executed
to check weothey g Oumber is to checK wheather
palindrDme DOt.
Y.C.C.E
DATE

(E)
Pxac tic a) 9

priot Practic al 3B)


Aim C# px o9rom9 to Upto 30.
and
odd o umber5
even
ot
to priat list af
Flowc hott - Ajm
e ven asd

The oxy Fox oop


fuoda manta)l
For 0eps olowe yoll iD
that
paegram ming code
eXecte
certa)o times They ore dy picol
[ollect ions pf data
uGed for texotiag
GyotaX fox iaiiolizo tin0 endhia /
iocrement delte meot

Medulus operatay ( ) a Wsed to


calewate the Xemsinder pf
A
+he Code
bused enspecifie conditios
Y.C.C.E
DATE:

frngran
wsing
class Quoter

pDblie static
stat)c Vold Maio C)

foxli= 0 j < 3 0 t + )

3
3
Y.C.C.E
DATE

output
E ven 0umbc

4
6

12
14
16
1
20
22

24 22
26 24
29 26
23
od pUmbe

11
13
15
Y.C.C.E
DATE

19
22
23 24
25 23

27
29
29

Con clus)on - Hence ) we hoye


Surc esstully execute d the C+4 progam CoD cus)Do
to print the ist ot even and od ex ec pted Heoce We

ist Pxlot the


upto 36. pve
Practical 4 DATE
Y.C.C.E

A im - wite a c# program to checK


weu they a entered yeor Practica) 4
Aim- wate progran Aoheck
weatheX

Flo wehort
Theoxy -
stort A leap yeal yeat wth an
adled to hecp the coleade) syochxn oized
Priot Entes 4 ycor with he G elGOOS becausc
Joput Tot yeax, Eathr6
takes thao 365 deys
Yeoty. 4==o to check
NO ways
tf the yea
yes

Point het a lear ya


(5TOPk
Y.C.C.E
DATE

Pangram

public lass Leap yeai

iat year = jot Porse Cconsole. Reed line )


yeu .00 !=o
consple, Wriel ioel oyiG o lea p yeox
yea
else
Jegp

output Entex a yeo3 2 004 Output Eatex


2004 2004
leap yeal
Y.C.C.E
DATE

conclus)on - Hen cej wc baye eU ccesstul)y hare


eXec ut ed the pogom to check weather e xerut edthe to cherk
a entered ye ox le qp yeot or 00t entere year
Y.C.C.E
Practica) 5 (A) DATE

Aim - wIite to
Floy dstoiangle
dicploy
with9oumevicmode Practical 5 CA)
Aim wXite to dieplaj
Flowchoxt -
start FloyJs tieagle with

Decla re 1,) j80 wsy K=1


Pr0t Entcxnober ot Yows!l
Theery Flys 4ria gle
Ioput Yows ))=1
Floyds tiangle qaus Visuel
appeal
|<=WS owmbex pattera algoithni
Lyes
Concepis Tt forests cuzinsity ohout
Mothemotical Ye latinas hips ihrough its
inhereot Duoker
J<=1 NO
leops
pigzamn ng
dhrough ts canstructlen pavn
the wey for turtherexploxatian ia
|Yes
compa tes 0athe matics,
/ PriotKt+ +
Eloys trien glewhile ant
haing
WOld pplicatlan serves
volua hle ia camputer saience
cducatlan. beginacis to
stop
prectleefundame0tal pregunmlag aancepts
Looping cenlitiea) stateaLotsy Eoxa atting
Y.C.C.E
DATE

Pragram

class Program

iot Pax se lconsole Readine C) )i

forlj=
console, wrteliae0

out put Entex 0umber ot oWs 5 out put Eoter AdmbeY of

23 3

4 5 G 4

12 12 13 15 15
Y.C.C.E
DATE

cOncusi0h - Hencey We haye sUcce55 fully


e Xe culed 4he
progrom to displ ay the conclusian - Heate We have GUCILSSfuly
Floyd's trieng le with Oumes je eXer wted the prhga to diaplay the
Flayds niaagle
Y.C.C.E
Pro ctica) sCB) DATE

Aim - wite a c# program to create


sto pwot ch.
wzite
Flowchort Step watch
Start

Declare stopwa tc b obja


start stopwotch,i =o Theoxy
cieatiog the stop wetch class fom the
Yes
5yste me Dlgonastie:
to
0amespace Dhis
Print H! tioe
preciaely megsure slapsud
Tastan tiatien - begio by crea tlng 4 stepatch
abjacd
stop s top wateh Gtart step coatiol- Emplay the start )
PxintTime E)apsed i methed to ioitiate
+ stopwat ch El4 Psed to halt t.
Flap sed ine Retrieal Acess the elo psed
Stop
usiagpreparties ike Elopsedete
4
Resettiay
elapeed t)me back to
Reset () do 5et +he
Y.C.C.E
DATE

out put G Microsoft Visual Studio

Hi Progaam
Hi
Time Elapsed: 00:00: 00. 0024164
yGing sy stemsj
G Microsoft Visual Studio Debu X Wslog Sy steou DiagabG t)as j
Hi
wsing systuo ThxLoding
Hi
Hi closs
Hi
Hi siatie wsl Main(stiiag laxgs)
Time Elapsed : 00:00:00.0022734
Siopwateh stopwath ûeN Stopluateh C)
C Microsoft Visual Studio Debu X 5tepwetch StaxtC)
for CiDt=o ++)
Hi
Hi
Hi
Hi
Hi
Hi
Hi
Hi + stapeateh. Elapeed
Hi
Hi
Time Elapsed: 00:00:00.0032609

conclu s) bn - Thus) we have sucLesstully coO clus)bo - Thus we


erecute) the cieqt c executet the prng ian to CIeote
stop watch. Stap netch
Y.C.C.E
DATE
Pyoctica) c
Aim - to gcn evote
the m ax Ksheet of student. Pxactiz al G

Flowc hart C pegia


stort geoeratc Gtuden

Enter student oome/


Theaxy
2Dter eng lish mks"/ GencTat)ng
studcat
matk
theo coleulode s
To put volida t)en
/2 Entx seience morks The
areoaba foxmat
/$ Entey 5oc)olslulis mayks This

Sum of oll fov) sbicts


tota) Moyk e uols pxeseotaten forectv KLLOYd Keepn
academic pertermore

o|P Peocentsg C
Y.C.C.E
DATE:

Waing Syslems
class Mokcheet Gehexat o

censole write (bEoter Gtaleo A2mc


censale. Readline 0i

con sole wite Eoter MaYhe toy Eaglahi ")


int e Mork s

int aMaxHe jnt Puree Ceen sale, Reallinal


censelc wte Cal Enter Murks toY Gacial studies' m)
nt sG Meyks iat Darse (eosalz Readliae ()
Y.C.C.E
DATE:

2 Maska

dobhle pexceotdge = Cdoub)e) todalMaxK s/4

Ghee 2)

e Mork5)

con sele Read Lioe (2i


Y.C.C.E
DATE

output - outpu|
EOter 5tudent A3e ABC
En ter Sto Jent namc

sol number 43 Enter


Entea
Eng ish 6 Eotei Maks for Eo glish i 76
Entex morks for
I Moth Eater morKs fo Math
ENtcy MaskS fo
Enter Mus G o
MDrK for s oc)a) s tudie s 7o Eatex for
Entet

MarlK Shect Mark sheet


Name: ABC
Rol) Nu mb cx 243
Englich : 7o En glish i
Malh

50c) a) stvdics 2. 70
Toia) mosks Jote) mk6
Pexcentu ge 70.007.

c on clu s) on- HenceJ we s 2ccegGtully Heoce We

erecvtcd 2he pregom to geDera te enected


mosK sheot of studeot . the
Y.C.C.E
DATE

Practica) 7
to make
Aim- write Program Prqetic a)
ATM m9chine tY9psgctioo.
simple
wrte Prayra to oaKe
Flo wchart - ain ple AIM machiae transgctioa

Declorc amout= 10001depos)t ywit hdrawy chajce,Pinzopxo


A
Theory
4 soflwaie applicotlen
/out p'u t eeE nter your pin nurber Ilp Pin/
Pin
tesifaed
tan sgction s
to masagc aute mated teller mochine
commAicotien
NO
Lyes
betweeo the AMP hewses back
outputi. he ck palante
2. withdzo cash
Variews bask datobases
3. depositcg5 h
4 uit
Input Lhojce
Usex Awdheatìc atlon Thepregsmheglos by
<hsico 2)
pampiig
Ixan sactlan
the
Gelectioo
tor heis
o0cehe
ATM
card and PIN,
js Duthent ica te d
the pI0grO m displeys a meny ofavailable
yesD)spoy boloncel
LNO 3) Txosctlo0 Pooce cs0ng The _Ser alects thei
T/p amount ond vithlram desined trossactlon and pregLa guides frem
p qmount an d deposit
them hie ughthe
4) Geculty Me45 Vies implemeots
cuse yes
Va2lous to
Vser Loter face
pavide s
b6Entet coect/
Pin
+o
-fuieodly iotex faLe that ollews
ATM eesil y
Stop
Y.C.C.E
DATE

using syslam j
class

publiz stathc vod Maja )

amo uot =000 de post


with draw
choice
console WaiteLjne (1 Eoter youy Po Nupte} ");
pio - int. Parse Lconsele BeadLin C) )
jf Pio ==4070)

Console writeljne welcome to AIM


Censale waiteline (tg check Balence la
consele waitelinc (e4 2 wjthdra
cDAsele, wYiteline (h 3. paposit
Pepesit Cash la n)
Console'. Iwitelise [il Eater your choicei i);
hoice
Sw)tch lchejce)
Case
Lensole MIlelin be La Youy BALANLE 2N
Rs
byeeK
ReadLineDatnselcesale depsit
=
MODNI THEA aENTER Wiiteline
? censole
Cuse
3
BALAcE
21)isl H_CAS
LLECT PLEASE olA WIiteline Ce0sale
) LEAN
BAL
CuMauat
withaaw> itelse
3
00 DF MWLTPL
ES VN
T MOA THE
ENTER PLEASE lo
wXitelin( Co0sole
AMOUNJ THE RIEN)Ejowriteljne
(b4 sle Cen
Case
2
DATE:
Y.C.C.E
Y.C.C.E
DATE

Console wijte Line (1e YoWR BALANCE 15 toy


ampunt

Consale wiiteLine (h6 lo ThAYK V p5ING

else
COns ole wIitelne (i6La lo P) EASE
ENTER cORACIPIM ")

Consale Wideine (1 lo HAKS EOR


VSTNG O)R ATM SE RVICE 1):

out put output


EAtex Pio Womter
Entes Pio Number
Do70 4070
2 check Bolonte WelcoMeto ATM Srice
2 withdow c0sh 9.check Bolance
3 Dopo slt cash 2 wjthdray Cach
3 Dep5it Cash
Y.C.C.E
DATE

Eoter your choice: Eotex

AMO NI TO WIIHDRA w
ENTER THE AMOUN T TO wI THDRA W JHE
506

PLEAS E CoLLECT CASH P)EAsE colLECI ASH


yovR CVRRE NT CVRAE NI BALANLE 500
BALANcE IS 500
THAN KS FOR VS I VG THA NKS )6ING OR ATM_SERVICE
OURATM SERVJCE.
C Dnclusion - hey e SLe SE fully
etecuted the
Hence, we hoyesucce sfully Moke 4 simple
eXecuto} +he
ATM
to
moke o sim ple
MachiDe tronct)op. A TM
Y.C.C.E
DATE

Practica) &CA)
Ajm - Write Progiam to
Dis play Lowed Tiz0 ghl ax
Floweh art - Aim wite Display
stort Lewer Trjzngul ar Matix.
+unt tlon
lower- tyiongulay The ory
matix Cuser mot) x A pigra thot
trienqulax Matx Malifies the joput
Vay = o 2ex0es aboye 4he
Dhe itselA remol
NO User_ matriX
length
LoweX Matiix A squoie motiix
Yetun true yes where elemeots abore the dia qen al are zro
Diegan a) The eleme0ts the tlplef
to the bott M right
usor-m atrjx Co)lengtn Square
Ex ploO Qtica
yes
Ttexoe the m2trix
NO 1tera te
thxeugh each calueo C) withia that
res the
3. curreo t clemeots positiza i )
folse the Jiagonal G<,sed thot
elemest
stop
ine Io
Convert
wrte CeDsole
Matrx
the elermeots put 0Wteint
(22 sole Cop
Realline
lD 3olConsale Iat To
CeDyert
tbe f the 22 G) the Taput (i! wrideConsaler
(1!wade Censele
owet lbehe play Dis la lo 'iwaite ole Cons
WOe
iot
sletie publlc
Exeoc)se26
public
stem sy using
Pxegxem
DATE:
Y.C.C.E
L
else
writel censale
setiag lo wte Console
anli wite(1o3 Censale.
Motrix The wide( eole, CO0
DATE:
Y.C.C.E
Y.C.C.E
DATE

out put
Pis play the lowex ag)ven Display thelawer
mutoi X :

Ioput the of the Iaput the 5)2e


Input elements in the motrix Taput eleoeots
ele ment - C o ,CoD : 1
e)emen t eleet
element elemeot
element
element elemeD
eleme 0t element
element C 23, CoI i 7 elemen
element C2I,CaJi8 elemestf2] Co
element element
The The
12
4 4

mot)X Getting Zeo lower tieagu) a matiix


setting 2 ero Lower t) angul oz
7 4
Y.C.C.E
DATE

conclusìon.- Hencey W
have succ esstully baye Sucre ss fully
executed the to Pisp)ey the exete the piagram to Diaplay the
Lower tolang u)ox mots)X. Lower Matj
Y.C.C.E
DATE:

Poactical r(B)
proqram to
Aim - wjte
Matr)X.
Pxactic a) e2)
Display upper

Flo wchart
Ajp Wte Preqrso to Diaplay
5tart Wppez txianguar Matr.

functlon
uPp er tajogulaT - molri X Theexy= matlces
Vpper tiangula) baye
enties belw the
VOr=b Squere wpper tiiang ula fomn
elimiaatiaa
NO method.
uset-matzi
lengtn
Yeturn truc yes TreverGe the MetojX diagpolly storting frem
the top le ft
2. At elamoate
NO
elemet s columo
Th is
yes the frem 1he below
No
to 20S.

Repcat ateps abd 2 for


Lyes subazqueat iega Del eleocat
reuro fulse
tiiep qula
esulting w)h
be
torm 2er05 belaw he
stop liegonal
Y.C.C.E
DATE:

Syatem
publie alass EXerc)ce 26

publiz atati yid


woi) Maio )

cOnsole wite (ie iala Display he


+2i204u)az

Consale wite (! Ta put the S2e 2f the


mutrix

CoDSole wite (0 Iaput elemeods

for ( i = o j < o it)

21CiÍa cenuALt IoIat 12 leenscla. Reed


Linc C)
Y.C.C.E
DATE:

tainagul az.
t+)

clse
Y.C.C.E
DATE

o ut put -
pisplay 4he upper triDn gular of giycn
motri the
pisplay Vpper

Topu:
To put
the
elemeo ts
size
io
of the square mgto)X 3
Taput the he
themotix
element - Lo), CoJ i 1 To put elemeots
clement 2 elemet
element eleme
elemeAt 3
element element 4
elermeni - C 23, C2J 6
element
eleme0
elementC2
The
J,2J
matiX Js: eleme0t
2 3 The )5

456 2

settng 9

5
2 3
sedtiag 2
MatX

o
+nlangular matair. tyi2ng
ula
pe s
9y Jipl toprPgrom the executed
the eute) s5fully sutce hove
conclus)no we , ce
hlen clusi
on con
have
DATE
Y.C.C.E
Y.C.C.E
DATE
Prqctjc a) 9
Aim - write to
progrom
Digils to wDtds. Pro ctlea) 9
Flow ch2yt - Ajm wzite
Digits
Theoy
Number Represen tatlon The pregro typically
hohdles 000
the ioto ondi vidua) tigts using mouà ulo

Maping
totemegt to map each diait (o-)
to Coriespon ding epreseltetlon

progiseosideas the elace


Yplue ot ear h digit Thic
diiding the
preaessin
seporote y
lcases The Qecls to
5 peaio
huadle speciol caces ike teaasasd
ltiples teo hesecap be hehled
Seperute logie
YC.C.E
DATE:

Piogrem
clacs cohNt
convert Digits Ta wozds
publlc stetic yold Malo
Iot

Consale waite Linc Enter the aumhes )i


CoAvex t Te Iot32Cee0 sale Rees LincDA
Console , Wte Line Numbed t0u);
Console wiite Liac ( Number io words : ):
Aext digit
Y.C.C.E
ATE

while Cauo )
Aumdigits
udigite-)
console wrile Liac)
conssle ReadLjoe

o ut put output
Entex the ounber EDtex the
64
Numbet 64 NåmbeY i
Num ber in word s i s}x fouy Nuohex

coD c)us)on- Hence ) we hayc COncui00 He oce


Gvtes sfully exe cuted the po0900m eXectet the to
CoOVert dgits to words. to Wed s.
Y.C.C.E
DATE
Popctical J0
Aim wite C
Jmpleme0t s9 cK w)th
Push and
pop opevotion .
AjM wLe
Flow choyt Implemeat

The exy
adhereto t h E n

detioesterke
Push This eperatioadds eleoeAt
to the toy f the atock Iis 1ke
placing aplate
Tbic
the elemot
hke taking the top plot off Lhe
pile.
to Imple ment stack s
Tais built-o clucc porides metheds ike
pep fo element oBolnulatiea
croate
List tD
|elemen ts add iapleMLni puch
AuactioAal/ty
Y.C.C.E
DATE:

Pangsam
using sy stem
closs Stack

pxivate nt aey
privaBeint t0p
pxirate at maX S2e

public stack nt
MaX Size

publie void pushiat dal)

COnsDlewteline Lit Gtack yerlaw.


push
xetua

console Wilte Liac (44 pushed 4dato


Jata the stack
Y.C.C.E
DATE:

publie vaid Popl)

con sole wite Lioe lll taK hder floN


canaet pop frtM an eDpt y stack )
Yetu0
iat papped Elemcat aay top--3
tum the stock 1)

eAGPU
COn sale, wite Line lil stock is cmpty
Yetuo
3

1
Y.C.C.E
DATE

closs pregiam
5ttic
Console, witeLine lH Entee the izd
the

Stock steck
while (thue)
Consale, wite ine( \o Stotk oper atlo0s Meoui

cenGplc, wide Lioe) pop :);

Lensole wrte ine(b 4 EXt?)

Gw) tb (hesLe

Case
the
element

stack Pushlote
bicak
Y.C.C.E
DATE:

beak

break
Jefault
Plea se cotex

EDter the si2e of the siocK Eater the the stack:

5tock 0protions
Menu oprotlaa s Men
0. Pvsh Push
2 Pop 2
3 Disp) ay
4 Exit
3
Displey
4 Et
Y.C.C.E
DATE

E0tcr yous chojle :

Eoter the elenent


E nte the e)ement to push :
7
Pushad the stg ck
Pushed 7 into the sta CK.
Mesy
StocK operatioo s
9. Push
2 Pop
3. Djs ploy 3 Dlsploy
4 EX it
Enter
3
E le meots in the stocK ! Elemests

ope rot'ons Gtack opdations


J, Pus)h
2. Pop Pop
3 Displ9y
3.
Display
4 Exít 4EXit
hoice !
conclusion Thus, we hoye s Wcre ssully Thys hove SVece sfuly
execute) the papgom
to jmple me ot execuded the to inple ment statk
slocK w)th Push pop opera tians. paegiam
eperatiens.

You might also like