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)
50 views
Lab 2
Muji
Uploaded by
vipar snike
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save lab2 For Later
Download
Save
Save lab2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
50 views
Lab 2
Muji
Uploaded by
vipar snike
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save lab2 For Later
Carousel Previous
Carousel Next
Save
Save lab2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 21
Search
Fullscreen
4d) 2) 4) b) Ge Chograrnning engage (hab -2) 4+ Teor. Cheratiors:- Qporators perform wore. operatiore onthe. operands: {fy caarmple + int Oe de, fg ; bao: ce a+b} dzaby e@=axb) f= %b; Hote, the operddou'+ 'denotes adtition operation an two variable ‘a! and ‘b's Tn this content’ these variables che donown 4 oper ancl Aimilaly, -..° —' denotes subtraction, x! denote mublipticalion and ‘7 denotes division opezations rapocti vety. Lappession: Operated and operand are combined topelher fo fxm onenpresion, hha onpseasion hos c4stain volue ns gr RUE — 15 #X/5 +20 Isom enpreasion 4 225 the volue of this cxdmble expression t4 430° Z | Spesof_0panalors Actthnolic. Opetaters “These perados on4 used to feefotmn orth netic opttations 07 the operands. + Unaty plaa(t), Undag minus(-), addition +), aublrachon(-), multiplication (3, division (/), (Module division). lonol. ote athe aelallored operators ate used to Compare arithmetic, logical and character, enpresaiony. Example + Is Lay than (< ) , tess than 04 equal to (£5), Is pecatte than (>), greater than of equal to(> =) ¢& equal (=) ,not equal to (J =)»AA Logical opetatow i¢ usd ty compote of Cvaludte Logical and relsbionol oaprestion. Logical pnp WL), dyicod OR (M1) Bnd Tit nor (1), 4)|ichomenf_and dectoment operates + forte and predic forms OMe present He 09 :- Li 5, che p Ha 6 phe -Inaement J a+ SE breguivalent to aeara Att IS post —indement ga. go beans t acare Bat bettas hos the eet 00 follows: aeartd bea. hed tb, 0., is fisat increase by 4 amd the terll & atigned to b- usaptes betta 51S executed the vue 4 a ard 5 are a=6 and b=6. Simi feuly, batts Ay the fet 0 follaue: bea Oéat+4 hat tn, first ais assigned tob» And then a inctements by 4 Phas apler beatt) js Cuecuted the value Ya kb ate: a=¢6 bee &)| Conditional Desalt - The conditional operator comists of two symbols question rakk(?) and colo (*)+ Jt tale thtee operands wo it 2 tevmaly Cpetadot + #)} iste opaale'- A bitwice opctate. operates ameach bit “af date. “brample: Biwi AND), Bhwise ORL), Bitwise Oxchaiee oR (mJ SEE Bf) 1 Shift ple (>>) , ony complement)3 ; Ss ype coating in Cis “the pracou of cOnvetting « Value from one dada 4p omothey « Thole ote “Luo yper & tybe costing Inc. fort ng ( Automattic. pe_Con vets t on): he tye of cating a popored by de compile, auto malically, when if enceunkou ited dala tes in enptetion. Snpbicié type cealing, teu whim & v abe of ome. lady 44 outoalically converte ty another dato 44m wlth ad basing 4b precsion 0% Sata infrum int = tor float num. float ; Hum_flod = Num—ink © I Pty Mk casting» ind Tn Hhe ebove ssamle ie Inge ee is oe b Q Floating - point value. "4 Oo” vomohy ‘ pet Coatin (Monuat vessiori Ki type of casting 4 ed eaplicilly by he Preyramnets Howler plecig Be dae befete He _ te ees) Ape in porontheres ofote flowg Num - Flot = 410-9; int num. int ¢ eS Numing = Cnt) num -Float + | | Eypticéd cob) eet bo inf Jn the ofcove ecample , the floating point velue "Id. 9! j'¢ opbritl Coated to am Inte tewtling in ‘Lol, . aplitl type Be oe tk i 1 Me sede dads con's holf the entite value of the source if te shold be Chereled “when Petfosniry wry y dey of Pleclion % “Unt rphndty behav tog byte canting Bb pretbrt tn dhe Prosar.ING Lype promotion dy the Implicit Conwetsiyn % Gorm Ly a comm ny type duuing fhetry op, fomelion calls b Orutd COnnpeLibilddy ofa Operations « Troyer, Promotion makes gymatet UYppta Int sited anf Ip eprosiOns , operanda of Afferent thes le converted basedo, a Kicerely of “yfer. tena Hine de
vold naln() int RF 40) b= 50, %,4 5 Lette x t4a — ttay gate, % bey - bea; Print ("Value aad and Value og LE hd" a,x). POE 5 Value of bay etd" a, qn, Mond Weg = 1d 04); ? Output Value 4 a= 413 and Value of % = 156 Value op. b= 43 amd Value Y Y= 140 1rin = 3/60 esidut see = e760 D's min ond Jsldy ed se. Figs Flowchart fr Q-No- 5:Po GuiadionNo= bt WAP to Inpub seconds anf Convert to rninute Ajgstthin Step J donde Hep 2s Rood eteconds on woe BH 3? Catufeld min = Sec /60 MEY: Colette 4Widual see = Seek 6 atepa: Sisploy Min ard swydual decs okps; Stop. Source Code Hinchede <5 joshy # Include Zeonto-hy void maine) int min, see, Lesidvel. sec » Pritt "Enter yo number of atecordy: "J; Lonfpy " besec)» mmin = sec/éo » YeIidual_soe = see 1-60; PUL" hd seconds =. minutes ard 1d seconds ", sec, min, Ae sidudl sec); , etal); Enter the number. y secon: too 400 Seconds = 44 minvies and 4o seconds,Displagg Reg senses ‘and keg - Parallel Fit. Flowchart 4 g-Mo.€2 =¢. WAP to compute equivalent heAlstemce t {v0 nth is 1004 Ri amd Ro yy ham they are connect hin 0%dt, and por allaf Connection. Algerithr. Step 5: Start Step 2: Read the value Y Mdislances to, nesiaters on Ry and Ry: wep 32 Caleutate Cqulvalent Keslstemce in weries Reqv. serion =RiERy HE YS Oot culate Cqubvalewt sestctance, in Potable} Rea. parael = (es Ra) Hey + ®) apo: ‘Dis play Reay_seriea and Requ—-porallep « BEDE: Stop: Loutce code FH include
F include
void ratn() Sat M1, %, Yseries, Yporallef 3 printf (" Entes Begistance 9 Ast sesister ="). sont "AP", By): Print" Entes seatatence Y 2d desistor = "); Scant ("f", & vo); CSeY = XE vO $ ¥ parallel = (wi ¥ ¥2)/si + ¥0) 5 Print? ("Tie couivadent resistance \) Th sestes = ENT Patollel = Y.f "" wsetion , Sparablet ) ; () )feed a, bi dy arlOrD 35 Lb hte Jz(2ep) +g) Fig Flacbunt of g.n9-D-Qutput Entre Redidtance 4 1St reaiates = Enter résiatence 2nd sesintee = Te cquivolent resistance Tn series = 44, 000000 tn Parallel = 3.94 4096 Question-No.2+ WAP 4» evaluile te enpreaion : V= (ery & PY aly yes Algoiéd hin. Sipd Sturt S#h2: Read the values gH 2b, Pai % gy SIPS! Calealaty Y= (ery Jats Worry) (agp? Sep 1: Neplay v Sith 5 Stop. Source code F# include
oF include < conto h> Hinclude < math A> void mabn() : float Vy arb) P42 Xd 5 printf (" Enter the values of @, bi pigs y in the some oder, efor ade by comma ="); seo (Dob Nh 1h, TF MA tht", a, Wb, YP, 8g, bn, By); VE powlaty, (a4arb)/P 0) + pow Ceuy), e5)5 Paint (" Votve op = cht", VI; Fetcncy, 9Figi- Flouchent ofp Q-Mo—~2— Jo a —— als Eniee the values of a4, p, commag = 49059, uy 556 Value g V= 6049649 Question NoeE. WAP ty Oh values of Uho0 vahlabley 4 Bf Aethn Steps? otlort oth 2: Road the Volues of amc y. wtp 3: Declare, ‘tompotaty vaslable Lemp. bth At Put ‘temp =. mey = temp, asthe Vole. Of % bey offer Sup ping Source Code include
H#lnclode
I Tn # include
void main () chok ch ='h?, printf ("\n Coup 4 the" ob)s priolf("\n Case 9 ; /8c " ch): brine? ("\n cose gs Arbo) ch): guencys ou j Qutput Cue 1: b (ase 2% b (me 35 4 db Hinclude
# include
Void main () char sdx[oJ= "My Nome is Amox."): brink ("\y Coued t n8", sty); Print (""\n Case 9s 39 s!', stv); Print ("\n Cage 9: 298", 542); Print ("\y Cose 4: 9988", st); Print#(" \m Caae 6: 1-199" 540) PIE \n Case 6: Yeas", sth Prints ("\ncasga: % 98" $9; Al) )We Seger gt we My Nome is Amay, iz My Nome is Amy, et My Name is Amay, ne M en ty Nam 4 Nome ast My Name is Ama. we! My Name 1 be #inclvde
4 include
void mainc) char strl5o); print? ("Enter a stings" sont ("7 Soc", sex). “ ; printf ("" Reog sting Is: getchc); i Out Enier a stings Hello T am Nisa Regmi Read stung is: Hello Tam 5" sty rst). 46 Faivelde (Sulah> llemae ge f Hnchde
Heoncept sete sett “eed ating #include
void main) chet sly [a0] Prine ("En boy alAlng » "), scomf ["¥7, a-20-9)", six); Print (" Reog sing is sefern st). guru; — i Dutt Comment. = " sue) , ; Leon ("/-Ta-20- 4) ates i Enter strings nirjasenSundeg Te wend He ches eae 7 Rood sting ist nlroj26ay CN Countess Chase ° than a-Z and 0-9. 3° +#include cstdio., H include ccon to. > II concepe Of Seatch Set ty toc Sting > Void rants f Chet, se[20]; print ("Eien Sxirg: ") seamf ("L T°N]" ste): print (" Reed st2ing ig. 1 gett); 5 i , ste) cartstb Enkes Seeing: HeMoNdovid Read wring ist Hedly Comment. SP" ATON]"6t1); tb seeads chotactoes inte the whe onrag until iL encountets the choracter 'N!, )iscus.sien Fhe Wah exercises in C proguamming provided Invaluable ineights Into fondamentot Le oe G9 increment operators, ith rnetic. operations, foxmot specifiers p and inp ut /o utp ot fonction Tsugh ante on cxploralitn, ttudonds gaired prrockicng Pepevence in catlting code ty execute epedfic tusks , featerane a cheofes ondesatarcting f Ptogeommlag Punuples Gy Sunning any anoly ing Hhe outpt & ty , ahidents QePbed The importance d TR propa Hoppe p Of BLUE format apecifios wage cy] tyne biedsi0n for accur dle dota ation. He. eneteise ale elbivaled c2/Eenll Hhising an? Problem —
You might also like
PPS Handwritten Notes
PDF
80% (5)
PPS Handwritten Notes
142 pages
AKU PPS Pyq 2019
PDF
No ratings yet
AKU PPS Pyq 2019
11 pages
python model practical..(set 4)
PDF
No ratings yet
python model practical..(set 4)
65 pages
fpl set A
PDF
No ratings yet
fpl set A
13 pages
Bhavya 4th February 2023 Notes
PDF
No ratings yet
Bhavya 4th February 2023 Notes
16 pages
Basic Handnote of CSE-101 Course
PDF
No ratings yet
Basic Handnote of CSE-101 Course
43 pages
Python Assignment 2
PDF
No ratings yet
Python Assignment 2
12 pages
Week 2-6
PDF
No ratings yet
Week 2-6
44 pages
110120104014-CS8251 (1)
PDF
No ratings yet
110120104014-CS8251 (1)
31 pages
C Programming Language
PDF
No ratings yet
C Programming Language
55 pages
Algorithm
PDF
No ratings yet
Algorithm
39 pages
Smart Interviews Notes
PDF
No ratings yet
Smart Interviews Notes
75 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
MCS-011 Problem Solving and Programming
PDF
No ratings yet
MCS-011 Problem Solving and Programming
13 pages
Notesof C Language by Abhay Kumar Awasthi Till Recursion
PDF
No ratings yet
Notesof C Language by Abhay Kumar Awasthi Till Recursion
27 pages
DocScanner Mar 1, 2024 00-59
PDF
No ratings yet
DocScanner Mar 1, 2024 00-59
11 pages
Dec 13, Doc 1
PDF
No ratings yet
Dec 13, Doc 1
28 pages
C Language Notes-1
PDF
No ratings yet
C Language Notes-1
41 pages
C Language 1
PDF
No ratings yet
C Language 1
44 pages
Python question bank
PDF
No ratings yet
Python question bank
13 pages
C Language 1
PDF
No ratings yet
C Language 1
15 pages
Computer - Practical 2021
PDF
No ratings yet
Computer - Practical 2021
16 pages
PPS Ques Bank Answers
PDF
No ratings yet
PPS Ques Bank Answers
23 pages
Computer Work
PDF
No ratings yet
Computer Work
42 pages
python notes
PDF
No ratings yet
python notes
25 pages
18CS752-Python 4
PDF
No ratings yet
18CS752-Python 4
16 pages
Compiler Design - Unit 5
PDF
No ratings yet
Compiler Design - Unit 5
34 pages
c programming
PDF
No ratings yet
c programming
26 pages
Computer Science Practical Amit Bikram Mishra Class Xii Science A
PDF
No ratings yet
Computer Science Practical Amit Bikram Mishra Class Xii Science A
18 pages
Verilog Mod2@Azdocuments - in
PDF
No ratings yet
Verilog Mod2@Azdocuments - in
37 pages
all time favourites 1
PDF
No ratings yet
all time favourites 1
3 pages
Properties of Datatypes PDF
PDF
No ratings yet
Properties of Datatypes PDF
13 pages
Python CCBP Notes
PDF
No ratings yet
Python CCBP Notes
85 pages
Cremesc16 Minnie
PDF
No ratings yet
Cremesc16 Minnie
8 pages
Module 1
PDF
No ratings yet
Module 1
20 pages
Cs Notes
PDF
No ratings yet
Cs Notes
28 pages
Conditionals - Boolean Values, Operators, If, If-Else, If-Elif-Else
PDF
No ratings yet
Conditionals - Boolean Values, Operators, If, If-Else, If-Elif-Else
13 pages
C Programming
PDF
No ratings yet
C Programming
42 pages
SOUGATA SOO_ME_22_Computer Language Lab Assignment 1
PDF
No ratings yet
SOUGATA SOO_ME_22_Computer Language Lab Assignment 1
25 pages
Adder enhancement techniques
PDF
No ratings yet
Adder enhancement techniques
20 pages
DocScanner 18 May 2023 12-40 PM
PDF
No ratings yet
DocScanner 18 May 2023 12-40 PM
18 pages
Python Practical
PDF
No ratings yet
Python Practical
20 pages
Pps Lab File
PDF
No ratings yet
Pps Lab File
32 pages
CD Practical 6 To 10
PDF
No ratings yet
CD Practical 6 To 10
10 pages
Pyton Notes 2
PDF
No ratings yet
Pyton Notes 2
29 pages
Module 2 - Verilog HDL
PDF
No ratings yet
Module 2 - Verilog HDL
37 pages
Module04-Combinational Logic
PDF
No ratings yet
Module04-Combinational Logic
24 pages
C
PDF
No ratings yet
C
25 pages
116295
PDF
No ratings yet
116295
16 pages
DocScanner Jul 29, 2023 8-16 PM
PDF
No ratings yet
DocScanner Jul 29, 2023 8-16 PM
10 pages
110120104014-CS8251
PDF
No ratings yet
110120104014-CS8251
29 pages
PPS imp (1)
PDF
No ratings yet
PPS imp (1)
23 pages
BCP AB
PDF
No ratings yet
BCP AB
65 pages
C Practical, 1st Year
PDF
No ratings yet
C Practical, 1st Year
129 pages
Python-3 Basic Programs, Keywords, Math Module
PDF
No ratings yet
Python-3 Basic Programs, Keywords, Math Module
16 pages
PF Theory Complete After Mid
PDF
No ratings yet
PF Theory Complete After Mid
20 pages
C Notes
PDF
No ratings yet
C Notes
44 pages
Lab Report 3-4
PDF
No ratings yet
Lab Report 3-4
47 pages
Basics of c Programming
PDF
No ratings yet
Basics of c Programming
12 pages
Basic Ele Chap 6 Note PDF
PDF
No ratings yet
Basic Ele Chap 6 Note PDF
11 pages
Note 1
PDF
No ratings yet
Note 1
12 pages
Civil Engineering Materials
PDF
No ratings yet
Civil Engineering Materials
6 pages
Computer Programming
PDF
No ratings yet
Computer Programming
4 pages
Note2 1
PDF
No ratings yet
Note2 1
21 pages