You are on page 1of 32
TOG Ka 1g WN TT Ae OT BUCtUNES FE | T[z Sem Engiocertng. Tnoduction bl bod wage “Pseudo Code Solution fo Problem’. | The Phudo Cole fo the fiest Step Pa Lowi Hing a Progfan » Phrudo Code io usect ef oes Peo Pammers to help translate From cn English language deotehou oF Oo Rrableen to Peagam UI 2o Writer fa 'C oS “ Pseudo Col a ComPact onal fafroal neg h- Level desert Bow oF an aliyy’thm that uses tre Sbiuctuval Conlintond O6 Progaming tang unde” Sence tte Psudo (ods 2 nok An exeladamie Pog No Standahds WHE defined for wig a Example Rroblem': Rint the nwnbers fom 4 oF ond thetr SQuates 1 Movube -1 Solution Start with the Number # ComPute * Sduare Peink {he number and PEs SQuare- lo the Same for Cath of the other numbers from 5 409. | t E Aa Algoittm to the ColleckPon Of. Rotenes akich Five a Precse mettad to Solved frelon. Tt & aw Ste by Shep Proceduxt followed bo Sole a Givin Problem Baste Conte that Provide: bin ambijou andi Preuse Sts to Sewe a Poblum Ercamtle' i Stee), Lnsvalt zeJ Start | Step: [Tatu fhe mma SPU with AJ Read. Qumbuyg> Steps’, (Com tals HS SB Numb AJ Gr gtanber & Number Stops | LBMPlag fae Mumbo and Shure ; Dent Number, SIX Stios! CetnishesS Stee. Basic Conus of a C Prof’ The Basic Cones 6] C Progam Fnclustes Communk Used in Progam , The main i Progkann haces And the Jenetal Outline of i OC "Proper . , These ahe the VaRious feabtes tat must be incluted 1% On ery CC Progam Comments ond Profennig Stjle ef The l?ne thot to not °n the Pheudtocodle | Omd! Lovttten od tre begining of Cath Proghem with tre Lllowing Syonbools Gish" #1” Comment | The lommenk ahe Mot Sractly wauiyet beause @ Profan Withoug the Comment to | aloo techn’ Gabby Core » But at Some Part Lb te Conbidehet a6 2 ood Pro garnivg Sys The Comment vobith desoibt the hove deborot’ ou that 4g Pio be tobe Solvesk the Cornmeal Bptnk write /#*” andl endo with #/- The Syepol, A ond €/ ae Goll Comer tat deli gaits belawe thy rakic the begining onde nah Of ttre Comment Peart Proffan’ Pant numbsts rem 4d */ The Program Heder The nexe two Linu bf the é Progam Akter the Comment line will be : Pin dclucle main () Ary Une Pn ov Parogare tet Start with Syoobol He dg an Inbtructiow bo the ComP! le’. The Une dE rnduse tl tte Compilty tO allow the Progfam to Pesform Stomrdad Input. and Oubeut OPevaliows and twPll be bay Pract; Of the Standed fraction Worry A function fo & Bul ding bolo ff | AProgsarn thak Porfpens Brie PeA4 Calor TIX The header file Stdioh will be Tndludest tn the Progam as, | Suto > Standedd fnpuk [pbtted chiar Sage tis PLE head file < The Selond ine after the Commend, Maint) 45 tre main Progfam heat Edy Pro Mot halle @ Main Reecyplom fdschion ince this to Where The Comte: begins bo Creel, o Pro Yan The Parentheses ( ) oe nelersody fos vey fnhem Fn ao C Rogar The Body oy Actim of the Rojramn'- Tn aw CPrgham , afber the the heade oy boP lene 7 mo Sebo brates { § Contatntag : Sesto of C Statimenrt which ComPyse the ody Glled the actor f tee Profan: PereerererernaernretraernnernnernreTnaeTeeee “The Structwre of C Progam : he 1k Peo awn Prooi Poat numbers form tog %/ FHinclule morn L) { | /& Action Porblon Ytre Prpom #/ ; ee Declaration, Ass? got ond Pint Statormonk = hhe C Statins test ae delle, Vadfacles , StougsSDhdaun fn “thane, Var lables Oud Pork the ? Pape oaion Ves2ables ae becesaton Statinenh’ Data tye» - Int (Pnsiger) the fist C Statment introduted Gleb os adeClavation Statmed , {t 2 a. Vy Coultal Peak of Oveuy C- Progfan The declatatior dear bu the ComAdg- Ob Stooge locattons ox \lad fables to use fn Rogen. AVaRable. 2a Name for a Phystlal lolatlon Wohin the ComPutiv teat Gr hole only One Vlalueat atime. AS the Name “thelf fds labs the Valtable Gm Chonge 1h Value. As the Vastable Numer tohich holds an inbger, Soceclde 16 dat tyre as tnt , thet io a Simplest Pntiger dalityr. in ¢ And aloo tre Spoumber holds an Pntiger, tre Sane ta teger dled tyre Gu be ntl todetare tne 120 ' Variables a4 Shown buew, ’ oe int Number y Synurbyr 5, e Fok Mumbo s Diiyee are oe ae The (5) Punctrabton ak gird. af dlechsab er . A Sunidlon teminabic teeny County Ctibtint C FD lormrotnt Ung donot He Fncluste Comeile’ Afreckven dour not Beed aw Semi Glen Side these Ake Not a C- Statemenk And algo the Main Psofam hudler dow not Neeol - beGwe re Lo not a Comblet, C Startawrent The Pheudo lode mod ?fitsl by VadZalle- Stabe With numbers ComPuks Synunrour Pint number, S7rumbu do Une Same Lr Munour= 56,7, 84 Tn the Above Purdo lode tre modi fel Vadfabler ob. number and SY Numbee - FIPS IN MEM Stodamerte eee The AS igoment Statomcact Which lorprater AValue ant Places Pt fra Given Sooge ll The Actual Procening Of aA iGoment The Quali fier Sioeck ov Unsigned mex be apPiteh to Chay or any fwhget + Unsien tol Numbels ade abowys Pos' tive Zero, Ona 2t has the laws 4 angttmeb’C Module 2, Lahde 1d Numb OY bis n tak tyhe- * Sort numows ade ett Poshtive. or Negalhue numbes. . Prout? LF Chavorkit, ake 8-bF 6 2 Unsigned Cher Vatinble have Value, biboeen 0 and ASS ! 7 Signed Chav Vagfables have Value benocen 188 ont (2F Declarations of d?ffedut dallsbytee'- Jn Lower, were 5 Dl Chat Sti Lioo0d, | Loe Gn tat altze Vatlagtes though, ‘Ss declaration aloo Se fo : sl.o5 Bak aeelo) Chae = '\8'5 douvle x = 1S} The Auali fer Constant [lenstJ Ga bé Usd fry dechuabon 4 any \AaLable to seetily Hook PE Value will be Unchorgect - Exam le Conge double P= 2 1SEF8ISHIE | Gonst Cher eld = “ WelG@me" 5 The lonst deChtabor (om apo be Woot with aatey otrguments 4 sat Strln Clonse Cher) Ihe Vaxtou? “lyees of OPevatrys- oP Dns +Pryiteened ec Ofexadors Exe +, -,%, ete 1, p> Assigawent exalts Ext St Tn Crement/DeGremedt Ex aty-- Tm Igees ol lee ; of ehakS r > Relational eyabos Ens <, 742, Logo Ofervatoys Ey! peu 1 | b+ Cond! frond Reakors Ex 2?! | BH ge ofetaboes ce! Re | Arittoehic O%6iatoes! TRS pfexators took ade used fo Peddoern ositimebre OPexations Cl Gultr action, Ce Colleak cnitiomedi ¢ OR rab: she Vette. arttimee OP eStores ore fheon bdw Addi throw + Buotack ow — Prt MulHeLaken * SOON LL Divistow / Paste tle eee Pro ffm | C - Progam Show Ussge Bf Atom bi C OP Bakors \ dEinclude Smtle arssgomust’ Sinn ent: Synkew = Vays Le = exPreneion 5 : ! = 2 SA = 10s Meonstent Aa = bs IrSsifarle. Qa = xty; /] CxPevyiar - HR, the evPremtonr O~be O Cnttat, \fadvia.ble ov aa ex Rent ond - > Short hond Ui gomat Statement The OpSabovs Such a4 +=, —=,8=, J= Qnd Hz ae Gllled Short hand astigomed Ofevators. The AUsignmesk Stolerent that Une there OPerabors are Call assign met Stakiments . Cfevoted LP Sacvemeut HHO Examéler Qzeatio; /SiPle ayiigynod +z 105 [Shere bond aurea nmenti Statiment > Muerte ASS1Qomtuc Stakeen ek ; Assignong a Value OF @ Set Pf . Lrsues fo drffcdent Variables in One Skakprent Called nerisigament Seb S Examtle': f=10; sy fei; Gay ee Pegek=105 2 frenod K=105 eS Muldfele ounignmned x Statirrent - < & = JnCstmenk and Deowmedt Ofexators: Tnoremudk Oferator, +4 San fncvemeudt oPevator This to a Vn any OPevaber. Tt tarvement, te Value 8 a Variable by Out. There atetwo Ways Of tn Caemend Gftvackoré Show bdo Bet See roma Pret rome OH j eee teevalwe of oO by ! Yost tncsement | oe The “nceement OPewator ++ bo Places frame di Fodtely aftr the Oferont 1 io Cll Post Pace ent - ExamPle! Vetd matnc) i 1 {, | Aeettebeo tnt @= Qos a=20 f oe 1 a. ol Pate aeyd", Osi (ROwkeuk #/ po Re in Ocern eu !- x The vnremengsierabo ++ io Placed befre the Ofexand x Sig Glad Pre facrem ete Example | veld maria ' 3 \ Gata cals x : . s fut aalos « a= lo + og ‘ a=l Prantl" Lda): 7 Oluetul y ll g The difference between BSE andPre (trement: Let a=do Post Srccem ert ean Ett Vale ate bea b=20 Ou 2b Paicremneaed by @=ot] =a The Cittint Value A te VaIcable % unchanpeok Chien Ph tnCremends the Vese'eb le. Pre. totrerea pe A ie Taceenendid | pa Oey bette, \, TrewemeakVee poe beal From the abeve toe Brak Valuer y o's demain Bone, tooNahies tb ake df . Detronent OPev eter © La decwement Qkexiter ated t decseragil the Value & a O- unary OPevaloy - TT con Vertabe by Ore LS the. boo ways ag deoremet ORvahors ate i s we “Post decrement QaQ-- | Dart Whe ‘Debrern otecsle Pe decremed’ --a 4 a by | Example! Post cletrement Pre decrement : Ve'd main () Void maint) {. f ea int X2 SF X--: Pei nt . oe EC Yd) Rate Cyd" x) OubPut a A b |" Kelatronat Ofewatrs- TOQEW OG The ofevators that ave urd Ze fend : tne yelation Bhie bebween £W0 Gfevonels ake (allel Yelabonal OPevete rs The cdotiomshir between {190 Of eodol Vobues: _ true Colways 1) or Lave (abways 0) HDescatPlvon OPerator Prrowfty Assottabivity > Lom tran R | pefebvght blebs eat Se _ ie vight Tees oe gee [ss ert ve} et UH 7 iS LSS Equal a: a Lege £0 rik LS Not Byuar te 2 Pept Or An exerenton that Contains Telatfonal | OPesators Call Felatvonal CxPruwom Atb>e J Nahi d #e/ He Lnvelid OPLators Not ? a= Evaluate tha CeProvton Loithin Parentheses > Evolwate Una Ofewators —7 ENelwole ANivtim tC OFRNHOM/ex Repiens > Evalut Relttinal CxPrevers ; E ‘ xamele! [00/20 <= lo- 5 4+ Sohlo (Nove! x Patten BC Co helo St Sore | OP Aad ow ae Ond-Thn Cr _ Relattonal Sen ote OP oa tors dhata Value Leve lonsicliial for Fulse zdds Vale one Cons? deret- fee True + The oPevators that ake Wheol to lombine foo or More Yelabional exPreAstons he Collet logilal OPevator s : Tn other Cd, the logrcal Ofevators ate used Zo Combone two OY more Xelabton al exPrug? on’ a ——_., & Desasetion OPAaty Piovity Assoliotivity not Cunaey efevakn) | 1 bef bevghe lofi Land (biomy erent) && 9 Left tovight a OY Cbinary Oferatre) I 3 heft to vigit Lofzcab Dor The log*lal Not OPevation denots by Ofexater | "Can be true ov falre: The vest & bruce TE the OPevanet a falas anak sefoubl i < Gulne TE OPevand is bruce Cfevand | ofevond => oz = Truesti) Tadae (0) Foe le) True Li) Sp , Logitah, Anos The Logital Ano eferation denoth by BPevator "RF" beue Tf amd Only *f both t6e OPtvands ate Cvaluatd bo tue. TE omy one Of Oevanc eurdna td Flot, thevrsult's flee, Ofevend! AN Oftranckd Test Teruel) && — Teueld) ‘True U1) Feu ln && False Co) Fatoe (0) Feloolo) 46 Tere 1) Fabre (0) Faloe (0) && Falre lo) Fale Co) e : The logtcas OR OPexation Ls denoted by Oferater Il de true Pf and Ouly if at least ! One of the Ofevangr 1 CValuald to tue TE both fe PPerade ate evalialis tofele , the wthult fale. ‘ Ofesandi OR OP ond @. Feekutt Faloe (0) 7) ©) Faloc Co) Fale lo) Tee Teel SC Filag $8) Tred Tr 0) Il we b) Truct!) Eveluading LoGitab ExQintons & us “The Pewee Sule bo be flow ed while CValuabs the exPrencor- # Paranthe £4 * Una Gaerne A Ayethmebic exPremion * Relational &xfreii en * Aogrot eKProvom Exanle: Evaludh the etenson atarb bE [Chase dad &e One Gees ae Ont aca om & OO Aft Swostituting The Values +2 >684 to }/ Ml ler GoM 2 Kas yea>G eed ff nig 8 aces Le. 13 eG ME tl niet ad yp cee ° Veo — isv6 FE 1] uit eb gq £25 ) bi | ate? ge Ves 1 461 || wish & © 1 Sei We. ho 2 1H] 1 40 & wl [fo _ Conattionat oflato The Condtenal OPerater to ako Calld ternary operator. As the Name ends tatis, On peer ater that oPevalin 0” twee OR yancle i, Called texnav Ofevator The teAlnag OPepofars oe Syotox s (exer)? exPa t Pfs: 5 Ce) do aun OcPremton alnuatd 40 bre /faloe <> PL CHP Sa Waduuabed 40 dues, xb 2 in Creek) Pe eyo, 2, tpbeatd tothe, CPs 2 Gott 7 od: cH ee Exot: aa Mex = (a>b) Pas b; : fodae: _ _ Prefen fE taclute Rintee™ ott due of ab ni): Sof (yaya, a fey | of _ big= Carb) Zasb, Prenlf ("By sid \n", beg), } Se a OubPub! 7S Evi Volw Bay b , Is hs | aes be hso fe (arb) Par be/ bg s ke [ie big 2? #/ out hod _ Vid meiacy : i Sitwise oftyators'- STS The oPevators +Hat ate Wiel £0 jmant ruled : the bth & Given date ate Caled bit wise Ofeyativs. The Vadutour bitwise Ofemabe rs ore - | : Dasatelow Oferater Recedsute Asociabuily : k rBruisemrd = & 3 LR L>Bitwise ow | Ss Lor | LsBit wise Kor A 4 | LR PB itorse we $ ' Loe jefe Ship & 2 L—-R 2 Le, Isoighe Suse > Pe < Bit wes ES EF tae Grtestindng bit Postion’ both the oPerands a%e 1, ten AND oferation weak oa 1 ebherwise weak ¥n D”. The AND Bato Olen e tes by Syfeo be GS Example & OAM O = Dbo =o OAM 1 =o Cepiubd oF 1 = 0 | AvO0 Oo =o a 1fo=0 \ Awd =o en or Evan. Rogen Hinchdle <&dio- ny j | Vord mains aL int 6,0) Qs 10; be 6; cz ak b; | Rent d Ld= de", arb, 0)! Tat Halt pbon ; a= lo 00 @® loio b> 6 eso 0 110 Amo Bib Be A oa Coo f000 0010 1&6 22 BH wie of | | Lf the Cortaton ding bit RsrHons 17 ' both the ofevands Qhe 0» ther OR oPrations | Bhul 19.0, Otherwise OR oferabion webulé ‘| | The bit wise OR oteraler sulted or denoted | Ifo = 1 pie oe ee by Speobol “]" 0 oR 0 =0 ole _ Oo |=] _ ft | oR 0 =I Oe }oR } Hirclude XK Stdiod Void maint) af int @,b,C} a= Jo; b= 6: \ czalb; , tal Yd-yd'a, 6, O Bret wise Xo! (A) S&S & Lf te Capistiding b the ©Pevan, Co | “| Dabo? Za om ' Binpwd ele Oo0blo\0 lb Oo000)l0 ; Pe Seer Ge 4 © 0001110 MEAs vol 6 “MN vt Posttions in both ds age" ot ffevent then €x-oR oPevakion bulk 40 | Set beruatce Zero (0). O X-R o> 0 OA0=0 Ow~oR 1 = | Ont= |} | X-oR o= | iO, | | xe 1 =O Plo. Examtle Proghane | Hindude Lotdio.h> Vold rata U) { ‘int 4,6, €) azo; : : [ C=a%b; Reale zd -%d 2 Vd" ab,0) } Tal abl tabion ' Q= 10 ©0000 %0/0 be 6 ©0000 oll won oe po0o 1100: puiruks 1o%6 = 12 | ee Negacts or One's (pmPlun ent ie The ©Ptyator tas Zo Used £0 Chomge CurSey bit fom o to | ang 1 to 0 fn Keecepiesh OPevand" Glut enn Comttemes » XawPle, Po pom ca XKStdio-h> | Void mats l) | I Unsigned Chat %, 6; Tattiall Labi om az lo 0000 lo)0 Chose | Qe=lo; I { f opefty | —¢ “ I Aiattlivd “d\n "ab j Pro LI] oll. I ! { i e i e b=na; OutPut wlo = Vhs” | | | Keft Shift operator! (<<) The operator tat fs wed bo Shift: ithe dak» by a SReifitl Number Yo bit Bsr tions towards left Glud Left Sift oPevaboe : SppborE Brent b= 4 << Mumm i Selond OPE anot « J Left Lett outer’ thse Frese Pog (Con siot Nisiatole ) + Fest operant the Value fo be Shifted: > Stlord ofexedd & SPelied oumbel A bib fo be Shyagel . HEnclile, “Stdio-h> Votd matt) | int BGs | Dafbtali Zain es Wea bo PIs | Pint" Ld ce =a") — |= 10 j Nob: Lege SheFE bY [ Gre bit ds mutiPly by 1 ' ti Tegint Shift oPevatee (>>) The OPevaber that i weed to Guipt te clots by a SPeci fred Number Of bit Resi Hous Towaads 3 Pybt Calas sight Shibt Ofer ator Spetoeh Eeaomtle'- b = a > Owen 3 ST Conbtant MVasiable (seconde ( Bgba cheesy Oferaber fest Ofexand Ctonctont[vargebe) | The Lect OPeiand do Valid bp be Shi fled ~The Stlond ofevank Sethe Nurebed® of bls tobe Shéfted: 3 Pro lame '- rue Hinclade y te Fd", a b):| OUut 5 | lO >> l oS Nols: Right Shift by |-b%b 4s divide by @- “bseCedence Of all the Ofbdatrrs' ( Hrey. OP otors J i OFevatow Cateseegf Odes Offieledente — A scoadivity o) Taney Most Brackes/ Lee Pg | CI Frenchion Galo | Ar elamests nae Raw b Unosy Hy, iat & gue Cos tem oh 1 of 3 Ofewator S aa ug Lok Osstg met C Lor Ofexators Shift oPevator ee > Lok. ‘Kelesional oPcalses K, <=, % = Lok Fanuaity ofesales ==, |= Lok Bitwse and & Lok BihotseXoR N Lok Biiwise OR | LR Logias and ae LR Loge oR I L>R Condt’ eval ; (OPtrabee * eee OM Gnrnewt a +5, -2,/5, #2, 22 ReL evator S Exonple!- X= Cob Strt (be — frxa¥0)) [@ad) somes Oe) 2 ae cy Xi (-s) + Sot (-s)*l9)~ Ht 16) Cant) L (5 + spt 5) #9) ~ Ae 1 #6)) [Can wa (S+ Spt (as - “ee (s+ Soxt (258 40) /@n) (s+ Soe bee i /@*) (st cit (1)) /@4#0 Ne ( s t+ 1.0) /Q@xd VW (st 10) /2 oe 6.0 /a Ve .

You might also like