Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
47 views
11 pages
C Program Ass 2
Uploaded by
pottipilla068
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save c program ass 2 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
47 views
11 pages
C Program Ass 2
Uploaded by
pottipilla068
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save c program ass 2 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save c program ass 2 For Later
You are on page 1
/ 11
Search
Fullscreen
MADANAPALLE INSTITUTE OF TECHNOLOGY & SCIENCE Ot Rey (UGC-AUTONOMOUS INSTITUTION) ay ~ Alfiiated to NTUA, Anantapur & Approved by AICTE, New Delhi NAAC Accredited with Av Grade, NIRF India Rankings 2021 - Band: 201-250 (Enge.) NBA Accredited - B.Tech. (CIVIL, CSE, ECE, EEE, MECH), MBA & MCA Department of Computer Science & Engineering Assignment Submission Details AY — 2023 — 24 Subject: CORE /Open Elective / Discipline Elective / SOC Subject Code: 23CSE101 Subject Name: INTRODUCTION TO PROGRAMMING Name of the Student &-qyo hn Roll. No. Q369|A0574 Year /Sec 1- CSE - B Sec “ATL ‘Assignment No. Marks (**Max 3 Mark) 2 ‘Assignment Moodle uploaded Date | Uploaded // Drafted - Faculty Sign with name & Date | goy.Chaiper-Hhamed psa s 7 T>4 Unit 3: Ql: gegplatn any Pre staking handleng -Runctfone ufith eztample unitsq2: How woul you diPRasentiate the uses deRred chia types, etouctune vith unton!? Gxplafin with the oPa aittable example. mania =r Unit 5: Q3: Wat : a ca & & pagoam ha, Seappig oF bwo 7. chary4 the value oP. a voafable ust pass y value and pase by ReRerenae, aAssignment: J eee Berphain any Re Sting handling -Punetione ws stsfing landing -Linct Fong he ee ee tt “the paectltnect -Rinctiong which age deeigned “10 honelle Pefigs of avalable 77 the {hoon atstip- hn! wih e2tornple. ¥ stolen) 3= “The, -Punction geluans -the length oP he etoing, Baample t= stalenifarne); hig will Sebuan the kength oP the Slstirg Sloged mM the vasfeble ramet). Lt ata cat (= “Thee -Runckion Concaterotes —heo slsigga. Brample = slacat(rame mame); This wil concatenate the steing2 Slosed fh the vastiablee nomeLJand hore] th the oadleg fn which ¢} fe voaftten. ae Slacpy07= thie Purction copieg the value of the second Sleting -to the “Pract sising. Exornple - stecpy name! rome s ahi wilh copy she | Staig en rome -to She Vasfiable name!CJ. | a : © | > staompU- This Punetion co¥piies “00 Stefigg ¢ | Baample ~. slacrrptrame mamet) 4 This competes the | | elefirg th romeLJ with the Stating tn nameil). Tt geluang 0 iP the Staingz ame Same ext Jelvang a value lessthan 0 4P rameCI
+0 loweamge damp $ sislioa(name; r+ shall conve the whole | Slofing Stoaed in he vaafobe namety-tp lowenca ge. & | | | | Mebaley lergth B= stalent)-funckfon- : , Fi okey facton aeluang the legth of the fren hig. xt doesn't Count null chonacten “NO% 0) = indude (At dlio-n> i = fnolucle < sheng shy fnt maine) chaa rame C J= “Hello” 5 fot lent, leno; len t= StalenCname): len 2= Salen CYeily wold "95 Patink? (« leroth oP ee= gan": pare , ben Ds fr " | aoe. ° ae oP shez Yodo" "Hello woald |, len Pe Outp te , a i Ue } ean ot eran Na | Coy, seg: oy? | Ft ts fa. copyfig Sood Stefing into destination slain hypothe length oP the ckettralion slaty = So0ugce Stateg, \| ms= | =Hirclucle
tinclude
Tot main’) 4 Seco statis and ~fwie out fot 4.52 i= Stoampcst “Hello "97 KA wn Ann" 4405 ae luan 0; 5 a Outpube he diPfesence behween the factt Vahee bP NOD) and | W(@) ig -5.@ Fow would you ie dating lowerrase tatalwac) ~ Lp the Slabwoa(etsirg) -Aunetion aetuang lLowagcag e- Paggeom 7 =H inclucle
Sint mance Choa Statbo]y Point? (“Enter elaing:")s geta (stad lloeads stating Rom congole patot? ('stefn tg: %9"!,Sta)5 pafint? (Nnlawea, Stsng B+ 68 ‘Vatsleoatst>); geluan 0; ¥ Output s— Shteq Stsing MILs wea stating IS MILs Z lawes, slag ig nite A isfRepentiata she user dePined chto types si Se with union 7@epatin withthe help Pa Suttable example: PPReoence_belween Staveluze ond urfon {0% mM unfon we can ony eortialtze the -Pragt data membes whegeag %n a Stouctuse we can initialize rrany data Trembeggz at onde. # compiles allomteg mempar Ra each membes of a Stoucluse Wh? le -oa a unton rt allocates @gual to the size of the loogest chta rrembea- using chogacleng, *Toe = memes location while Praia roman ye ale aca in — » eloucluae we Gan access andi ual membegg Simultaneously whi RA a Union ewe can only Access | OMe membeg at a time: | spaP we change the alte oP a membea tn 4 Stauntuze, FL work afeat PLE cthea membeas bub to a Union, eg the vaie oP pre member rotlt affect the AZ. - |___Slauchise | Lnfen \epooad: Vthe keyuad Slauat ig |The ley! ward poten ze | Used 418 caFire a giauctuy used Uo clefine avniens Size When a vasieble fg when a vaniable ye asseciated with a Staue qgepatated with a -tuae the covnpiles [Dntion the com fles vailocates the merecay v/alleabes ; NX the mremeay | | Fog each membe ThE by oe ts a | es vs Y considening dhe [Size oP stoticluse tg est memeay so | P2ea4es thon Da equa}| St of Union %S to the sum vf stec €Qua) to the Size of 712 membeag.- OF Laagest membeg. Memoay Each merbea within a \mmemoay allocated B slachuse 42 assigned Shae by Tndividual Unigue sivaage aaea — lmemb, OF oni aie ston eae OP Union. value Altesing the wake oP a Alkeaing the value of Alkectiog rrembeq votll not ab feck fany pP “the membes Dthea meroang oP the |wrll Pies otheg Stouctuses- membes, valueg .Niece: membeng Hatt falta. |. bon P member, z paggacm bekween wnion § eePhn YUTob ; — |DrPResencea Fel ween rio “let's take an example to clemonataa te he cl#PRenenae Slourtuse | rdVidual member can be ameaged at a lime Revera) mmbeas oP a Alrpluae can tortialbe at once Blouct Pala f fnt_ as Hoan uge both ia and b sttnuttaneously cha b; Yala; Stauct hia ye yea= 370k y-b='¢'s 0k kle can any member, at any Hime get only one membaq an | be | acce gged al a time. only -Hhe -Pragd mentary of a unten can be | initialized: wnion Galo f } any of lican't Upe both | a and bb al once | chon bis | y Dato 7 | | Urfion Data 207 | a> 32H Ok { w.b= ‘C!s INO! this aPRectp the value of | eo. We an accegg only Dnt and stoucluzeg: =H Mroludle ¢gidie.h > UNM Tob a. Union choa rome (327; Pleat galaoy 3 Sak woakesnio; ° de . NZ and Haucluaez ee one Pld at a lime.Soucek Steuct Job = + | boa name (a9)7 Float saloay, ' | Fok wdskeanlo; ! %STob i | a rrafnt) | } Petint® (“size oP Unton=ded bytes", She oP (vob) )y paral? C\ngize oP stauckiae = Yo lates") Stze oF (sJob)) Setuan 0; y Quiput | Size oP urfon= 32. Se DP Staucture = yo. i Ce Pes rt a Swapping oP +0 numbea gs and | he value oP a vasiiable ing by Vakie || gain|cot by value = \ TA cat by Nae method the sialue gP--the actual | pooaretess 4s Copted dhe faemal pamamecteas-an_ || othe woade,we Gay thatthe Value of the vasteble 4% uged in the cal by Value method- GN _by » Pesenae Gm j-IA colt ey oefenence the ocideess oP -Ihe Vasfable t¢ paszed into the -finctfon call ag -+he actual pagametes. ste. value of the actual pasarmeteag can be modtlfed toy changing the Rorrel parameters efnoe He addoegs of +the actual pavameteng % Pegged. Ge| nll by valve Exorple + Sunppirg the values oP the i ent a=lo7 zt $F include cstdio-h> void Sup (int sint ); //pactoty fnt maint) wot b= 207 paint ( “Bofoge sungping the values lue oP aand b aq main Aze/ed ibeted| in rain: Wn" 1016) 7 4 i wna Mpainting +he val | i pe of the. function | | i | ampia ib)? _ pafinth ("APte sunpping yalucg fa rain aed so ed’, | ailod rll he wae oP actual pogometens do not chorge by. chorging he foorna) pasameteng in Call by nralue O10 bag ¥ : {| void swap (ft a int b> i iH fe temp * J qr i temp =a 4 : i| O=bs 7 | bs temps I ern ing values 0 Parelion as 3.0, b= 10 APtes swapping valteg @n main azi0,b=20os Gh by gefenence Broreple: @wapping -the Values OF the lwo _uoo%ableg,. Aaclucte
wid SHOP (int al) F/pavlolype oP the Panctfon | Ant rain 9 fab O=107 fot be 90; Paint f(y Belbae Sawopping An" arb) *Mpatinting -the Value of Sw0p (fa bb): a 5 Patni ("Aes swapping Ualues fa fain O= ed rbo= todo} arbi zhthe values of acho! posomebers do choge to i Cot by SePesence 10=10,b=20 | | jhe Volueg in trofn as od ibs 1od| a. ond b in mofn. ¥ Void Svap Ufa tRa sfAEEb? A” te temp; bemnp = tax Fa=*b; #b= temp; patntf (“APtes suapptg values in fianction = qed be4ed\n" a, ¥b) sl-fRamal bg posometens ,Q=20,b=/0 \ y Oubpuk= BePore Swapping the values tn main as Io; b=20 Pte, Suoapping values fn farction a=20,b=10 NPtea suoppig values th main a=30, belo.
You might also like
PPS Handwritten Notes
PDF
83% (6)
PPS Handwritten Notes
142 pages
Chapter 3 Data Handling
PDF
No ratings yet
Chapter 3 Data Handling
38 pages
C# Topic 2nd 3rd
PDF
No ratings yet
C# Topic 2nd 3rd
36 pages
Java Arrays by Rajesh Sir
PDF
No ratings yet
Java Arrays by Rajesh Sir
29 pages
C++ Unit 2
PDF
No ratings yet
C++ Unit 2
46 pages
PDF Scanner-07 - 03 - 2025-04 - 36 - 47
PDF
No ratings yet
PDF Scanner-07 - 03 - 2025-04 - 36 - 47
48 pages
Oop Notes 1
PDF
No ratings yet
Oop Notes 1
153 pages
Core Java
PDF
No ratings yet
Core Java
51 pages
Adobe Scan May 18, 2023
PDF
No ratings yet
Adobe Scan May 18, 2023
126 pages
Java 2
PDF
No ratings yet
Java 2
66 pages
C Language Notes
PDF
No ratings yet
C Language Notes
97 pages
CP Unit - 05
PDF
No ratings yet
CP Unit - 05
25 pages
IP Mid Term Notes (Complete)
PDF
No ratings yet
IP Mid Term Notes (Complete)
73 pages
C Programming Language
PDF
No ratings yet
C Programming Language
55 pages
MODULE 3 Functions. E-Note
PDF
No ratings yet
MODULE 3 Functions. E-Note
78 pages
Object Oriented Programming in C++
PDF
No ratings yet
Object Oriented Programming in C++
28 pages
Unit-1 PSTC
PDF
No ratings yet
Unit-1 PSTC
25 pages
C Programming
PDF
No ratings yet
C Programming
42 pages
Js
PDF
No ratings yet
Js
26 pages
DSC Notes Module 1
PDF
No ratings yet
DSC Notes Module 1
56 pages
T&P Notes
PDF
No ratings yet
T&P Notes
22 pages
Unit 2 FDS
PDF
No ratings yet
Unit 2 FDS
47 pages
Computer Class Notes
PDF
No ratings yet
Computer Class Notes
18 pages
C Notes
PDF
No ratings yet
C Notes
44 pages
C Unit 1 Notes
PDF
No ratings yet
C Unit 1 Notes
60 pages
Oodp Unit 1
PDF
No ratings yet
Oodp Unit 1
38 pages
All Unit
PDF
No ratings yet
All Unit
7 pages
C - Home Assignment
PDF
No ratings yet
C - Home Assignment
8 pages
C Language 1
PDF
No ratings yet
C Language 1
44 pages
C
PDF
No ratings yet
C
25 pages
DocScanner 24 Jul 2024 9-56 Am
PDF
No ratings yet
DocScanner 24 Jul 2024 9-56 Am
27 pages
Adobe Scan 04-Feb-2024
PDF
No ratings yet
Adobe Scan 04-Feb-2024
20 pages
Assignment
PDF
No ratings yet
Assignment
33 pages
FPL Set A
PDF
No ratings yet
FPL Set A
13 pages
204-5 Unit-1
PDF
No ratings yet
204-5 Unit-1
24 pages
Adobe Scan Apr 12, 2023
PDF
No ratings yet
Adobe Scan Apr 12, 2023
27 pages
CPP Notes - 01
PDF
No ratings yet
CPP Notes - 01
30 pages
C++ and Oops
PDF
No ratings yet
C++ and Oops
29 pages
Adobe Scan 05 Dec 2024
PDF
No ratings yet
Adobe Scan 05 Dec 2024
19 pages
Data Structures Unit 1 - SVS
PDF
No ratings yet
Data Structures Unit 1 - SVS
21 pages
Module 2 Part 1
PDF
No ratings yet
Module 2 Part 1
13 pages
Fahad Assignment 2-2024 2-32 PM
PDF
No ratings yet
Fahad Assignment 2-2024 2-32 PM
22 pages
Lab 2
PDF
No ratings yet
Lab 2
21 pages
Unit 4 Pps
PDF
No ratings yet
Unit 4 Pps
11 pages
CSE Most Asked
PDF
No ratings yet
CSE Most Asked
15 pages
Pop IA2
PDF
No ratings yet
Pop IA2
10 pages
Python-Unit-4 R16
PDF
No ratings yet
Python-Unit-4 R16
18 pages
Python Unit 1
PDF
No ratings yet
Python Unit 1
21 pages
C-Programming ShortNotes
PDF
No ratings yet
C-Programming ShortNotes
7 pages
Cremesc16 Minnie
PDF
No ratings yet
Cremesc16 Minnie
8 pages
Coding Notes - CS50
PDF
No ratings yet
Coding Notes - CS50
14 pages
Storage Class Keyword 1720373206
PDF
No ratings yet
Storage Class Keyword 1720373206
11 pages
Bhavya 28th January 2023 Notes
PDF
No ratings yet
Bhavya 28th January 2023 Notes
13 pages
Advance Python
PDF
No ratings yet
Advance Python
10 pages
PPS Reduction
PDF
No ratings yet
PPS Reduction
5 pages
8tohc Void Main (Shingi Aas) : Corvso Le
PDF
No ratings yet
8tohc Void Main (Shingi Aas) : Corvso Le
14 pages
The Memory Address
PDF
No ratings yet
The Memory Address
16 pages
Model X1 Six-Shooter Common Settling Pond Layout Drawings 120207
PDF
No ratings yet
Model X1 Six-Shooter Common Settling Pond Layout Drawings 120207
4 pages
0192CS191070 CS305
PDF
No ratings yet
0192CS191070 CS305
23 pages