0% found this document useful (0 votes)
35 views

Introduction To Programming, C Notes

Uploaded by

siriksireesha7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
35 views

Introduction To Programming, C Notes

Uploaded by

siriksireesha7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 34
Ontt-t 4 PEE epee 42 paporonny + Pic History of Compulérs te The pate contern of Corpputation ¢ mernony computers are qoirg be | evolved ; 2) Dy Older days for calculation purpose ladvancernent i human beings. They fovented many toleuiation devices tlaty tei bate ured, Oe we ule sticks + bores tater such QS Abarut, Napier Bones, pascal Calewators, al fnqtne, Analy teal Fagine Tabutating machine 1 Bgl i (Abacun:- —Nbacun invented fp the yeor “500 8e' " chinese Ot ts tnvented of Becks, Rods, wodlen Rack» Te une to fergor arithematic Operation (f in those totes: ait can be Computer, os via roachine. y we Nopter Eones:- id bento th [97 Be is invented in the ae eH?" * Stetord , 6 peroroet Orthime tie Operation, .addt Hop ,Subtractfon, Huttiptfeation > oo be Srtkere , we use bones for the puspose Of Gaba sa | Shoutd be tsevedof tote er all |Something nunnbers Parca 66 there: y7at is the fast’ calduiating Bevtee for cBteulatior™ a cctmat point ne Wieillelh aon ne (3 1 case sdf Poscal Clic [io ee Prag RSet pe sali Tt & inverted tp the year “1642” by, pat? te can alo be cotled 28 Bebra 7 ' it# QS arthematic machine. >it ta 4* Arthimotte calcatotor - >t is Used “io Vepresent “postttons of digital. Ti is ured 10 perfor addttion+ Suberaction Foseal cattullainy’ ts 0! tooden ‘bo, tobich Conaist OF) + My hy rate buey ‘aterufl help of Geo Geos, +: oheels by the rotation of wheels trong ledipihy ae -+-tlere, Simple we 2 eect ter through rae calculator: far bate winea Pe Fenopy aap oo beat ¥ TE ts advancement Of” pasdat | Caleutators p , sciiaea " %5e is o digital roachtne calculators i ees inthe, 49 pas” & * Here, ewe use “fluke oleums’ instead 04) Gears: oobeelss§) 2 t * G o Sk G use to perfornn multiple ;pivistony) =) itera) VBI - RPh eases i ea Betgerenttal chogix a fn the *T is aster bated” rem ahty deuice tnvented yo t20 Charles Gabbage - Cte petfornn gee in arn bag the compra Previous calculation device tralytigal Rogie ¥€Te & the invented in the gear ' : we Oy De Sig20" by charles Rabbege: i+ hour lee ‘perporre vathinput +6 a 19 0F £9t fs a mechanical Computer Ft Operations: rang tat tattonal FO ¢ Herett & Ghalyeel Bee we Fave ws | Dijgerential Analy gern: 3 Maat by Et } ¥ Gt & invented #4 the! year 1ag05 by vannevor” Bush? pe ¥ It Ban electronic Computer as Supported bY oraly he dev thase ove by using “vaceurn tubes 40. oa "calculation vaceuny 4 Sqnals converts to eleckronte SigPals| th foster tay: ah “Tobutating Machine:- ayes. ‘ing hie ee, ¥It i : Dodou got nae inventeal. fm the ee oe oe Oe can Bott Stati sti ca: the person in teaman Halliaith « *abutating machine t Peas efor Store + calculate srthe Br: te the chelpeog pune iscard® iat “eat! iy x ct by ¥It ture to store 4 cateutate J IGilaBe¢ ” ySdemnset ae Marked Woon inn oie mes A. a ¥ Oe | és fuer invented (In the Year 1934 by 1 Howard, ett i baitt by IBM, Harvard: ei ta 15 pro: programable , digital Computer to 3 Gn aaa! oy dats 1K doers 1 Ot pea Hynclo enerabfontat Computers Fased on Lpecigic requirement of ubes | dP Gersation of Coreputter 1946-1999? i is nae le 94 unas butitted the year tV46-t955 ef « Cormputer CS Vvaccurmtubes The Compound that use to o Generation of ypu Input 4 output Operation® Gh this Generation punch cards we ube top inp W Hagnetic tapes + paper pores ue a |FHeresdn thi Grreratton Of Coroputers batch Opyrate “Systernl0-) were uit gts hardware - * Operating System take as to Thtract toith syster> di 5 | tion ©: * Greple batch Operating Gysterss capes 0” tases of Collect instructions actorciing 10 thet Geilarites: Gq- LNT NC ~ flectro nurrerte Qnteqrator and, Computer 5 LOVAC ~ flectoo Discrete Variable, futoraatic Computer: : UONIVAC - Universal Variable Automatic re “ Generation of Computer are larger insictes the -curpute rng are more expentive of it Generation of Computer neosly At Occupise Capocity Of trom Lige- Bie rd *, i, on s flael + fnoee $ Generation «oh Computers Lt ase -1965) eh * Ft was butlted the yeor | > 6s ohig yore WA one Hee FHere, transistors for ume, to built, ea pipriaticn Of. Coroputers,« ¥In ond Generation of Coro puteys ee li Panera. Operating Gitern- ¥ tere ,, we Can peypre, rrutttpte ntyoari, Jnstwuc tons at ne tiene. EY the acd) ere, magnetic core & sed as pian ra taher ec tay ' reenop Qs the istic is used Ceoonchry reemory: 4 en *Alere TE «Supports , COBAR FORTRAN. *Twansistors aye more cheoper to Save Cot: ka: TBM - i620 ; F t ft oi ee pe Tone 4 1 ‘ alta oeta #f & CDC ~ t6oy , act Wr of ‘CD es = 26.60)" Pitenepaey very Onivace - Nog id 2 Freration of Gxepuser Ci9s6-ta45) ¥ Tt uns bullkin the year tageniaae oy" * Here, Th this Generation Of, Computer. fe, ‘integrated chreutls- Plage VM ‘bom up: baa 7 ine “ald ap “yaaa Wes are pack of -ransistors ott are placed together Qt one plag Can we called as integrated Cineuit: This Generation dy Computer are more Sfratier in Sie when Com toith St 4.94 Gererabign Of Compute “¥ * This type of Computert are relfable + efyictent F tlere, we ure “remote processing”, Mutt processing , time shasing Operatt ing System oy gd Generation of Computers + * Remote processing Simple help as viatual pmeni ga 0] deter { lany where: Car be Catled at mernote processing Systern- ¥ tere TE Supporli routti sheet to eun Coneretty tn fe @ cated at rout? processing oe Spe: yah + Tire Shaving piety time petty anoint au the insteuctions DtIliZe ceu air * Here , ce ‘Support iP level 'p Cie Tn oh i. On, like a ee ' 1908 4 Cobal B2 ons Pascal - Paty ' fl Algol -68 a , PehHeL GO coids Ry fer aio, Ter ~ 66 , Toe -3i6 | PDP» Pelora! Data Processors iy Maru ge voell Of a easter Capte dt) ‘gododetiey: “! 2 Beoeraifon Bf | Coerpaters(ia ae ~ 985)" MF Te is buitked 1996 a ii Fr sere, toe use VEST ve tavge | Scale ak bee pie be, Dt Consist of Hatrons of “tranststion © aie” pide Bel “tog woud hoot a alte Chip can be Galle as vest. ¥ This Generation of Cormputers “ate butte | bots rere! “Cormpack ¢ e ful in sie 2 eqenjorrraunce - orn ots 6 Kipre, tt uses distributed Operating Systern 1 * ie, tere, Cimple att the insksuct fons re A’ DEc 10 Star 1000 tery Henge) jo - Cray ~) 5s , eayxne} of Compt, 1 anny 6 Ys the ae tl Gute a, | BP Gepeaktora OF | Grmpelers Ciaee Semana ; |x Tt was Butttect tAg6-Onvoards- +h . a le The. Compounds use to built & Generation of Cormputer is ONS2-— | Ultra large Leote integrate i-e, tk is roade up oe pee . jchips i : # jlere purely tk Supports paratle | processing of inskauction s:! |# Hore Cornpoct 4+ repre powenfi cornpawe with dther Gevierot fon j | Python. java, C,ctt.->- \#q- taptop. Pesktap 1 Notebook , Ulk2a book, chrorne book: a ae ' Orarieatton of “Compers- ptt encet 1% jevices uiter Components Such as Toput d Bout Px) Udte fit inctudes basic Comp’ Central pwocessing nee and Output ctevices: ey dent ere or x as the gottouing’s ich aed eis Es, Be Certral protesitng Udit (CPU) _ [Arthmetfe " 4 togtcat Legion prenrae 1M at laaniy a wat oor t of spy - Haag Jnput Deut mg ge Hine h yor Ag | Soput deutees, axe, thae that are exportable for "pouting Linput to | ee ST ee Py prone probate Ay the System: , ‘ THOM seat O bsg on rere "lhe pera 0 ony inde of input "Gelice Suthas Keyboned , House ber Qua F qeh pac oP wod Ov oo te Joystie —pagregt felon hind i400 I Scanner - ern plore bree gRlbars s ¥ Keyboard - Here, we “put ‘toput dypsténs to Nei 1 a . * 4 a pet Oo ate i piabeniis House - Mouse is @ pope device lies » FO vephebit sie Tt shoud | be .. Sisco ade ie qos: ance - Seong tots phdeto, >. Hfesophone ain age y .eiaes nae Bix # Centra\ Procensing ptt (opus ' *WHlere, again consists of theee units uch as Control unft 2-Merrery Unit 3: Arithmetic t logical unit « Control ott, Ate . Enetaei * tere, Conteol untt har full authortty over all the availante a the Computer Systernt. ¢ ¥ \Contol unte decides ahteh tnstauction executes cohen faxed 09 Mynalo: Fi ¥ are untt \ 7 ST Play movie. — document pototers - y sloyerend 1 wy? wd Loiting document — 3 Perjormtng ade tion. ~ / Ey , Meron Ost 7 ae : 5 ce | Merry vinit tt a place there, ve stow data th! Computer Syste’ ¥ Htlee, Coroputes suystens ue have 4i00 kinds of Ernemnony * V\Patmary memosy 9 Secondary ememeny: Patrnaey Memory, #| Pafmasy roemory udtd for temperory Storage Volatile. De COLO memory: he ty pouwes cuts clata tess it reennory - ¥/ Primary memory t called as RAM- Murdo access x thé RAM is Classtpied into two type- SRAM - State Pandorn access mencoxj’ DRAM - Dynamic Random Arcess mennory Secondary FRE : A Secondary roemory ginal betorgs to pirmabant oi * Secondary memory ore also called os Pon- volatile moernon ¥ tere, we have & ee een Of epee rexmory “Such as ROH Read only rremory: P-PoH ~Programmable read only reemoy. id _ FeROH - Brambte Proyarnpabis, mead ooly..rmemony: BR PRON - Prectsteatiy Proqrarerenbie aead only remot Peasy - POHAIOY D4 nuns. All the a memanies One al hese are called shall Ok xt bivoels A Feamony developed with “Yet ‘poor’ Pevoraree th compte port form primary Tremor y 4 Secordand” Memory [Special Kinds 0} memory Such ov 9 fib iota ene oe | Register rexery Register mernor's ave giver which ane Supportable to store Linn? tech arnount of dato je, use to Store Instouctions Cache wervory | De & one OF Special kind of memory | in coche mernory that coutd be access very f whotever the data is Stove asters “tence te & petweer Of primary memory Ond Secorctary poemoryss Mostly ca prevtouuly peelaret ad a yee i Placed in coche stoves) the fnstruction’s tohfch are | Ayetttomette & Hog ical unt This untt Suppost Ao perf ‘System: Arf themagte orm anithernatte at Jogtea! Operation ns En Compute’ Operations inctuce- b Pritheroatic: ' 2 Ndditiont+) whud) omyge i 3-Subtractiont> 4 gy 1 gaya mime a of 4h Mettipltcatton) b { §. Divisionl- } et , ani ree 6. Nodular dfuistonl” > where os Logteal Operations Luctrar loca! ano Ao HoT Nh intousttons simply ctenotes logical! Operatfons ofa e pee) inelruations the result of these Logical Operations Hy Pa ise, Taue con False Boolean values: | Logical AoA’ ob’, €a'or, Taal | i ail | 1 ean LF ofr of Ffol Out put dtevtces:- i “The ceevices axe those that are responsthle 40 produce putpal ‘ Fcoqputer Syste p ric | Here we have > many at put oleyicer gen ip Coroputer Such as printer, toonttor, Speakers, projecto™ lead! phot’, daptpen | Roqrare Counter 4 | Oe | Jo Cormpater System prograre Counter caus be definedt as follows Tr te used to store addaes of ext instruction tole enecutedt ¥Sieoply in program counter we store only address Of instruction SProqrare =r Tz Poon Pe 16 ’ 10 Wey 1 oo} mp apef 3s E i are design He ment tole eotth as mobile apptattions, web ppricatte * Programming larquages Catacterized into three categories ag, Proqraraming fanquage ) Ub eve Pr ae Vangquage Shown below ' ptddle level ee Rogramming torque: Yow - Revel proqrareming Yonqua qe: *1, “These Kinds 04 prograrering dorquoge ore easy 40 Understandable by Coroputer Systeres: 4 | Rese tanquages ore Atrectly accoetated ‘with Computer “Systern fe quick ond vovania] tctth put ony kroner “Ord Onter mediotor | These Yanquages ore represented in binary reaeoeh 08: ‘ails. 'O#Bece Volo’ Cevet phogrannnaéng, dathquiace! i two’ dypes: ot ti Rachine « tevel Prograraming »donguage | yey etd 9: Aeserobly level proqrononnteg ee Nochine level rrevarns gigeh 1 ee ‘of \binary eleree be teeta eel bee aicaes well iter sane plated E48 8 : ; a ievelvorquogy \fuish as yolfeos- brckos to opr. aes woth. ee Hab ate yee rotlal t rtest form of tnst wht Leg nee sb! SOY an aga oH Yarqueqe oD sae see 4 ry Understa VP Trese are caracterfzed nto three types: ‘: Procectuve Orvfented Programming Vanquage - 2: Object orfented progqrarerning forquage 3 Natural danquage + Procedure Oriented programming arquage * 170 worite sup “by step procedure ¥| Before ene ceating Competing the pops — Nlo pencting — éa “Cy fortan, pascat: Flere, tt does nor SUpporls Operator Over loacting: Provictes tess | MO Reciseabitity of Code , tt atlows functtons oe | Object Oriented Programing danquage * [lere, coe tepresent programming “ danquage fy the fort OF Obje i it Suppor moore functors when Cormpare with procedure Ork Progamming tangquage Pp Y Bolimosn wpa tau Here, it ABE oports Operator Over loading provider bec Secu fy hed oF 5 ¥ *& Ruscabitity oy code, tt ator functions: | The farnous Oriented Preqramreing ts Java.” nal oe yg 4 f is Fr i High tevel : r g thos are “Proipavernteng Racquages which are -€Qsile) unalerston Bae for te Pee pates, OF. bastty Communiating | withs oyster level Prograrmicg Varquoge ‘ yous sal _Petwee Of high bevel Yangquage Ard tow tel Atled as middle level Yarquage - aa Yerquage “requtiea Compile 40° transger’ the!'eo MAO ‘too level ‘dnd Loin level to high tevet! dale level Yanguage Rte ne “frarced watt Certate “sort of rater « te Johtte cleveloping of ‘Ae applicators! I” Bester lo at telasics ay sor, Oe x Achecking Sage Seequente Of txecuting Frstructions and, many other Corsraites Operations: The foltorting Gre proqrarereing danguages whete. One Aevetop applications as Shower below: Chructune Overy hanqogt - Gaapbicat_uter_inrerface Sane Ba | PYTHon web +Thternet application 4a ener pat Andaotd Application, INeb Application: toobile Appticatton Devetopreant} Supportable to JAVA JAVA Script R programing Language Stattéttcal Application sata Science Application, Machine learné Ikcation. Svot yt Core ins Applicat fon Stoucture Query hanquage Cata bose (se A, Garcing Graphicat uber Thterpace, Gare. evelopment Operetbing Ripe Bai Yew yrt idl PHP - Person ris 4 ree ment explication Bates 0F Cor Baste tas the oe Eee tom aived r£Sfl carspputes ‘proqiarsreing are Algorithrs oflow chart ; Sqntars variables ; Operators » Control low, Cormnre- Pt, Debugging ¢?p FE) D Lopt Zeonrreentat ) : pugqing LTD) Thterqrated Developing Knvieon i. 18 14) 4a orca aorq FROM A so. te cated ior: Algoritinre Plgorithrey is a Step by step processing nod pe myo oe 6 Plow chart |” | “Ptetorfou reps F ee? Can Be called’ ov" Syntans- Leni Ae Bt ed ad) Syntax ore -formal representotonr of program that ctescriber propa plot oreip ot ro: structure as shove belolb=| ©? | Pate hort H Toelude ¢ ction > # Tnrctucte econ:oche Wier tdci a ep levis | syle! bead ys = % body of progean. : Vorfattes:- Variable ta place where we Store Some vate ay Shon belovo: _ Wr Os 1p = sualu « mee dota Varfable ype Nope HPpparatus:+! ¥ Apparatus are placed tm blw of Operarcl» (a,b) to Perform Action accordingly volth Operator replaced ar Show betow + ithe tie i CETTE FST] > teqro! operator Control flquos Contiot flows Simply epimers working plow Rote eae can represented by uring following reethocts : Y 1 nested ¢ Cord tf ryene | pales. 4 onal | Sotteh | toopin 4 | rae While dowts[, “for: Corerenss:- a H Coroment are used to clesatbe progam lértptton for better tundterstanding (Chirtnpants Comments are not Compile Commenls can be enctosed W paditton I], ly fm theo tears: bn ~C" ploquamontng Cn OY wee Z - ‘Sui w/ # Console ts (owttploce tohere, we COM See Output Of a reyes Pewating a ia process Of removing errors. for esfectot, too: kf Program Con be Caled as debugging: ji | Actualty, Debug ie one type °t Qbnormal Conclitfon ent 4 a ts Saas ‘ ee eed c2DE)!- Where Juitarre to develop a proqrom twith all Statements :- ¥ In “ce " praqronn ming Vanquage Staternents are Seperated et ete Operator C5) And termimated with ())&micolumo: As Shown below: FE TERE ab, €5 | Aeclarative Ctaternent Congturton’ ¥ Tere, above atiare Cormputer promarming Ioane x E land Should be requixe for cleveloping % Progra i 009 Pete » those are FOUse roaming varquage ; ¥| wofth out this no Pp oqnanerntag Vanquages were ‘pergorro Algorttoro Haortthen 6 step by Step procedture of vetting 9 proper ohn be Catted as ~Plqortthm: &® Step 1 -- stort Step 2 > tnt oge 3 steps iftoge su ah 01s ear Rat 47 M4 SPEpNics Te, ioe etigibte to vote - 4 oe “The (petton’ eligible! to: uote 1m 9 Plow Chort wi i § Flow chart Ue pictorial re precent@rion ‘of : Algor’ thr con be catted At Flow Char a ‘elvetble 10 3 E Viz ra Cts 5 aed Lonsholiqes) of eotyiior : ad buborat Eelice pheno cteich Thee oA] | j ye “Bp Coroputer Siptern a eflanchart Car be davon i wing: “DiorTeot” ¥1Dia Toot & ctagram Edlitor. Es a Delpjut fo draw . OL CUntpredt Hocketttmg” eqn pea Maps, flowchart : bl . 1 ge oepart it: pPyter instal ¥ ¥ * ao * Th, *lthre, te: don Diatool Systerns- > Select -ptovochart Afagam Tools window PSelect draw the Corn ponent PtH 4 Spread the el beets according to, the Ons a Were GIL Components. cat hi AW Pctude Noid maimt ) f Imta,b,c; Piety (In Enter the vatue of a')% Stang Crna", bays Print ¢ Cp rte, the value of b")) Scang (“ed", 4); Czarth; Rinty("In The vatue of C1, ©); 14 Constants Siatyted «| Constants are those which can mot be once they cleclaret to the variables. 2 “ier “Constants aan be defined by using Keywords cated Const. *! Constante can be Seen in Atjjerent kinds of data typer Such 0 tteger, foat , string, Char, ne noo bah Syntas i ; : 3 Any datatype - trt 6 cong mea oi Parable name :value, ’ 4 ie drpoget i Ketcord-—const) i a 4 Variables = a Value = 10. | Kequoord : conte rican bes pidct Ml Bre °c! progam by using Vortabier, Value , kesqoords? Be die castes ; tt Trelude 2 conios b> Pi Aas ‘¢ De Void maint ) Lae | Tee Of Varfables “We following are aityyeront typet of Vearfabies 'Woal Vartable am I €lobal Varfabte 3) Raternal vartabtes Ht) static Vartaloles SJAutotmatic Uarfables , : fora! Noriabtes:- 6-4 Pt Ddccat \avoble! are those uohfch is uted to eytne insite of ito \The scope of loot Variable Lier within thar porter faretion. S)"The value tint we talk the local vorigbi that! fan be accessed within that t ouades thu HR Inctude utow yer 9) bcuseae bi i eR tatfe Var fables \- static \artatle! are thote this can be we 10 store : ¥ fatteally and carried Any -for futher Operatont: Aes CON be deyined by using Static Fey woord- Statte int ; — eteftnition State. @ int a; — cectaration Static intarw; 9 inittaltae. RAMD!— buf . Ainctude ¢ stdio+h> A Toctucte econio-h> Vofdmaint ) int A2lo} State int y+20. A>AU41O; YeYtto; 4 fat maint ) z Batatypes fay : Pata types mothing But repreentatfon of data in particutar format can be a as. Datatype: Pee on type Of dare is ee the memory oceupancey of data or qs ‘ 4 ee | | Paratypes canbe closeted tnto three types: \- Primitive datatype. a. pPerieved, Datatypes 3. Unser defined Dotatyps So prey & Pata typec chai At Shown a i Dwr {iver betow- a : 4 ¢ + bien? | * ly Z Stet ae : ee eee a A | heal Stvetuver : | Pointer tana afar). aaa Et e ba Pe de PRL daWiigs oP 1 ik Chav i a J i Hc pe 8 f oun mee a pF WO oudey ob Tresmeaas Mit : Here we hove two ty pel oy tonstaints i) (© Primary Constants @ secondary Constants Os aie is tt ie m7 Constant), perdhed 1 ure SI f avid mi Pi tere , Constants can be immplemented in a Program by using two Ways One by using constant , keqword Another one by uxing nome os 1) mney, simply ceyines agter toriting preprocessor simply we corite ctegine ing Of Headersiles can be eatled as macros which ts use to assign vat eannot be modtyfed srernatins Const; awe itérectty 40 the wartables that throughout the proyrare HIrcuude estdio-h > af Trtclude < Stdio+h> #Toctucte < macros > He eecaeee hich Hdepine % to void maine ) Vota maine > 1p ie t | const int 2:0; Int data ; int data 5 data -a*¥ x; cat Ht ote | data -a%a Préntf Cp td“, data) ; | Print $C In 3 ElThe fottowing procecture shows Ott primary Constants - #Incuude 4 nctucke Votel maine > t fonst int aro} Const float b=2-5 5 Const char st 5 Const char-str, [to]: PRASANNA 3 * data) ; 4 Print4 (“In the vate Of Ped", a) 5 Prints (“In the vawe of tf") b)5 Printy (In the vatue Of Te", c)s ievec) Print 4 Ch the vote Of 1S", chareste); Io 2 ; Mey *0 store integer vatues are “elasthgted into trode’ tint Spo) * x # x * ¥ Based On specifier of integers they are Classtpred into 2 types [Signed tertagers a-Unstgned tte gers Signed Toteqers St atlows both positive and negative Values im i fthe format Spectgior of imteger ww ihd. Unstyned Dnteger Unsiqned integers allows only posditt ve vauies Signed i wnt goed Onstgned 16 ; "e 3 0-9 Short int Cve) <2 40 0 Ge) 1 to al 2 4 | | Flot 1-3 Float Use 40 Store Secimod Yolues in Comput cr Pregfam * Flocting Values cot ‘be Cot crised into 3 ip | flout 9. double “3: ton oouble 39 wi int ve) 99940 0 CHE) | ee i 3 % floating Wives con be fen Sined Secinat umber that allowe foth Susitive ond Negative values. a e Rigg » for “Degative ¥ for Sign integer represet of Floot i a going float n seo % 40 Gosi tive Sloat ing ¥ The format specifier of f107" eae oe Leite belongs to gomily of flood of vaies when compare with ploatin§ fee a tol For neqattve Doutble mernory ranges {ro df from 0 t0 7 Yanges from @ve) 7a" to-! = 703 Da Yonues from cric) to = vatues thar use to Sore more range For posttive Double memory ranges he -jormat speeni specizier is hf Yom Double i rs ene? Tat HF ae looting values the use ED store Sr also betongs +0 the foreily of eaerpore. with Double WOW tt. more range Of voluet when req fo fe : a YY ative bong cloubk ranges from 40 For positive tong Double memory ranges to any ee J FO bbe ogee [The -formeie Specipter is “hfe We ad Character i” MCharacter fs use to store letters Flin programming a ae characters. ann be aoa by using char | The format Speetzier Of ‘char’ is ec , | Characters can aio be seen fn 2 types 1 " Signe characters 3. Unsigned Character popstonw go Kl Normentty characters yanget from a |For signéd characters xe For Unsigned Characters Neqative char from | “856 5) | [Positive char frome o tolaa: 2 j a 1 Postttve char from 1208-0 e bt 1 Characters ewe Suppose to store onty one character at a time j Votd slot * Void betongs, to primitive dato, “types STE defines orig eotat kira of tbs. 7 Kae cloes not Mave any ‘memory range i Poole *7t never Occuptes any, Memory - Tt Never return any Values Anteger ve) ti aoe uv) obo bi 47 es ae to ~1 Cave) oto (~\ ct CY) Stoo stave) 1.09 ‘oto 3 Constqnedy, 1 RIPOOT Baran AA ore Be Pa el ag “Whog soll Biv ga, Doel sat int cp,LAAC ;BcHE , CHE, ENG, total; float aug’, Char Grade; Cirsertd3 Prints ("In Enter the rrarks 67 CPI wr) nae ond Scant CA", 0p); f Print (ln enter the marks oy eAAC'); Sang (Yd, 4 2ARC)5 Brine) ‘In Soe the marks Of acre’); Beang ("1-4") 4 BME)? MAR HI) fe ETT Prints ("lo Enter the marks of CHEM") + Scand (fd "4 CHEMI) 4 Et Bipite y Prtots (“In Enter the mOrke Of eNG”) 3 bead ¢) Seang (“hd + ENG); PTS Bo sist helped total: cps tnac+ BcMé 4CHEH 4 eNGS it pte pana ® i Walid ay noede oy 1 a avy ‘eral 100 5 oilie : j ; Ef (avg < 0 tl avq >100) in” ’ DA Weds! sian) Le vee bed ie Printy ("In vorong entry"); i ‘ . 4 7D alow ache acre Wine else fy Coug >25p 44 00 260% ' OES oa \ ) AMBGR CM ok Meare else tt (aug retest a ae | bit a Hype g 1 ingle: as) ae Bratea Ye "" ' m + else tf Cag >=8044 avg 280), ipiona a ox Grade 85 } else ff (avg> =epd4aug HInctude void raint ) (ln enter the value of 0"); “Y.d',day; Wines oc mba, tT Dee ete ded bMay 19: wire wis eh eee | Printy (“In the sum Of 4b: “o); JWtehe a: i | Unformatted function’ ©! 1 er cere For Speetzying frput + output operations in unformatted functions le-Here wor have: the following -funetions qeterare > | Put chort) Jers cd oy Puts ¢ 9 * XA the Above are unjormotted functions 1.e, that hatno [format to give input ag well Ot output: on & & Particularly these ungormatted eons mn be fs (Ant characters AO Perforre input, Pe ae (Fetetore Di ete is resporstble for tOking “8 trgle give. input to the. pro “Here, TE workt Same tke as Sant to (¥The fottousting progrann cleste fer germane) ey H#Inctude : A a a Incbude econioh? PR cor Dope 3 3! Vola maint ) j kag | oat ee ae Char Print} Ch Enter character kJ; J tt ; ek chortig Vd 20 CAVA arena py ap oo Printy (“the character’ enteredliin KINO KIS bo r vo Rutchore 9 + hubgt f He DL & regponsibie for providing output to the proqae to oe. Lpunction - Purely putcharc) ts respons{ ble for prow time , we use put chor ¢ p-qunetion- nian Some like at prinkfl 1 Statement %o rated follow rules to produce output: Ege" Tre following "proryrarp ics Foes putckore pope BInetel ¢ void rraint ) ing outpHt Os, One ae Chor ky Petntt (fn Enter character ink"); St er Barc t 2c); Putcharces; 5 torite ae’ program by using getchare Yand putcharc)? HTnetudecstdioshs Ht Inckude n Void maine » ‘ Char k; Fetohar(k); Put char ie); " OY, csc Qetsc betongs to unjorreatied function’ of fnput Operattons 1 Heres TE Speci pees Complete string as imput+ The AfotlouotrO, exampl Pets) function. J uyh éq:- 34 Tretuctec stalio- b> ‘ +f Inelucte caucento-h> Noid maine > Chat narne(20]; f frintd (“Ie enter your Mame") 5 " qetse') 5 , i Printy (Ip Your name it 7. §", nance Dy 4 5 1 yt Patse oi . +t & & use to specify complete String as eee F Here woe cton't follow Ane sort of rules -for providing puts jaa ample shows: - + Include AIreudecconiorbe 4) 6, ei vere 4° nogrt Char name 20]; LAKSHM? PRACANNA” poh In enter te Your name"), “Sang C6" ' trate): | Puts trame); 4 ssh Irtte ac’ program by using gene and Pe 1 Thetuce 2Stetio-h> t Snetercte ¢ Conio- hy vot maint» est B Be + euhoerh te { esner bio nametk 5 ae ss Ay of “Type Conuersion + type costing ; \elery bial] le Tupe Converstors 4 type costing purely Supports converte o¢ dal [ " one format eformmat can be clone by ‘using type ro \ toa leqnverston +type carting bev ver! we have (wo 'typel ep type Ce to another ' dons can, be , 5297 tii He Heres f ae ; : be dmpltett converstor ak paptrel tH conte” 4 1 eg UTenpltett Conversion ’ : ' cao ‘ level ata # Tmpliett Conversion Support east converstons of laoer Eve types to héqher tevet ctata type” adh wri’ 1 F help 0 2 f Weatty with thé Dep HETHIS, CON bs, Gone bd using, utana' ont ong 2 Canoe be nation claro. EYPE f Gains on % Here, in Inopliett Converston test ,|Sreauer than Source cata type i‘ yeh at A I Be ill Ve > pret [ea char rate gd on ay gin gl UE TB Ie Source _‘Destinatfon } ¥ dara" ota Cpe! type sy SH Pept wh aG hati od 9210 0 5 [4 Tmpitett Convestons OFF tess egpiefent i alidata types tn their *The foltowtng fiqure Snows arrangement Pe oe gts increasing prdery)y cia hee arid let ey aunts snd if 1 - Shnpltedts conerstOD 5,018 A double, | 4 tere we are 0% fost yl it idocise® >! , < A aon Ade Be HIncude 4 q L| ie fe " low tevel tO void mnofnt yb joni |t0r8 treo Sass a i seco 2a \ rit rie oe si Choratpraber 205. if ne Bceupencées Of tnt nung et Short | tremory Print ("y.¢" alphabet); , 7 nurnzalphatet; we ee oe) SBEOt EC ahd, 'numd ji) hap esti pan of crpyony 2 © Meee f 5 » otis a. \Aaaget Bee Qutpar ola sbulett Enter the alprabet'o'-at “According to ASCII Cmertede Standard Code Ingormation Breercrange )- PE Here, tf we convert any Chawacter in to integer that’ Gor He" clone ae water at) in J eM) pod ¥Frore above exarnple, woe Convert character “o° tato ida in AscPP volue & 93% fy Vloe ; Write oe pr Rom) sukod f Jor to add choracter ord tnteger and a. te _Fetult At Tnetude + Ch gio nea Jie ee F 4 HInetude 7 jz BY; Suro: alphabet +b: Prints CInched ", sur); an a) i By Aert Conversion : =Pltet Dae SE: | Dav-etshaser a’; WH tram esayns Void mine ) Char alphabet 0"; int b, sum: PAheggryan | Moid main cas 1 otyinid é, int a=t0% FOES Ae’ atprovet): Print ¢ (*/-c" alphabet b)? eaptteit are usedt to convert one data type ‘into another ota ty forcebly to compiler - M Here. we may Convert higher levet cata type fnto tow level type as wellag low level cata type to high tevel alata type. F Here, Source data type ray he sratier than destination data ilies * Were; woe we cagt Operator to perforno entpticet conch oi FEaplictt Gan also be cated os type.ca sting - * (datatype Jwatiable tymidl ie"! Explicit conversfons are move broa ER! Hinauctedestain.hs J! etr#t Seta de < donto.tys d and more Cfpictent « £92 Hincuude # Inetude Noid maine 9 Void maine), , inti tata 210; fata, “boing Couble value; 9” Woot d 10.5, resi _ Prine (yt a) ;¥ TPS = Yloatya« ct C1 Gves)s Output to.” Value = Wdoubleya. pee jibe Value}; Output ~10. 00 ork iqheriaed tntvite 0.°e" progam 40 add fn Hinctucte 2stdio.hs H#Tnetude teger and chobacter: Yo tind recut! Char vatue ; ; Printy (td a); Yate =a 12 {Char )a fC6 ie iq’ st woo 1g > £/ MOH (bho oF pote bro # 1 ehuie) ; Sct, gttyt2 » Mowaloedl Algoritbrte “Approach Re pe Algorithmte Approact bxtongs to Problem Soluting technique. rb , Here, in thts Oppach tor fold finite cae of! steps! Cee tank. * 4 ¥ Hlgorithmnt are Deitgn to a better progrart Aborithent aan be written to renural slonquage if, Stare © [Stepac Yeadorbie. j,. Steps :- fta>b) «ee , wtf (ac) Ra Steps: Print a’ ts largest’ a eo tk chget ot ) * | ve, high level progeny Languages, ae & mo strict rutes orale Ole Stepe: print c) is largest: ‘ Stept: t4(b>0) ! 4 } Stepe : print ’b) is largest ele s Fepq : Print te? largest Stepto + Stop: | Probtern Solueng Strogtegt — Ki ere 16e bave to follad maturety 40 probiere solving strategy t (toon Approach, bottoms UP Approach: “Top - dovon Opproach ‘ ; ' ‘ 4 [tere , Tep~ cleron Approach nonin Programe futherly oléuides tnto $ Preqrars 4p solue the matin program eastly by reducing ¢o oy matin prograrn - 4s00)6 10 sot pee Water, we f Xow Top-dovon approach -to 42M the scution astiy. Fh E 1 Simply we break the jos into matter Jobs for Solving the ,. te fobs, 4 TBE Not mouth rmore Communication required among the fobs 4 Atutde “a * tere, Stemply anatysts’ re Saar ely analysis each and every tndivfctuat. | | fy Ohject over tial ed, ye larqued gy: sie Bottoro up Appecach Here, tn’ this bottom up approach we nat Here dyects Ore Combined to reach neath! 'progranme!) yi Btn towing fiqures Shows os it 1h |R-tjere im thir bottom up approach we follow the™ Comncepatt iri lation. of data birding + encapsul : etiere we required pot Communtcol oo = arnong eoch -f ebfery | Objects to define moun progr 7, f « Compleaity + Cpace Com mepleatty of “Alqaitte>: ¥| for finding “Tene complenity ay -Agortthe: 0 be re complet te ( ‘ : [Hre, we have to know about tro tadice Da | Fe, Heme Complexity Strnply degines irre taker £9 * ob i defined by usin [Tire Comptesity Of an coe algori ther can be defi 4 5 oO: in the lovote + | Por every algorithrs time complexity Con be catculated fo oi ways vithoplGe ba, plaghyrs) ey? t. Best time Compleatty 3° Worst tre Cormplenits : yi int i Best tine Complexity » i fs Shortest ib als : fait Ft stenpty textes ae time taken for execution Of algor: ie ae can be showr Os Ou. Worst tfne Comnplenity [TW te ere, it comsurnes’ Jor a! toagest these “Yorivesecuttors of algoritts * ey yet that aan be shown ot Oni) nit ¥ [Tre following procedure shows calculation of time Complextty: Tin): an? sandr: i For the above expression + Tf we Want +o caleutate time complesity ux need to follow Some rutes- nr ¥| feave tower order elements + leave Constant stort le yo nee 4 ay Pind ing time comptedtty ty toopteg, Stoterent leop oe orci; ienjtet) end } oftt Carb} llconstant time: Me Deny On’. Orated oops 4orliso,ten;t++) et a for lfeoijens jar) -0 het ZZ g On’ ~ be UU Statements ee om A ae ; Craib 2 To Ger syensyjpaa) | Gebier - 45 y Om" Space Coreptenity Of Algottnrs Tt simply Aefines total space Oceupted by algotive qorit © 3pce complexity alto defined by using “Oteratton This abso Sen in two Cases- w ek Space Compleat ty D+ Worst Spoce Compe My De fitlowing example show! calentating Space complee! ce of ‘gor thm. Eiqinany ates int abc, 2 Z=Atbac return Oz) 5 i ’ acai A Te atove algertinre, Contunnes 8 byes of renner: Own): Best Space Complentty te om Pt simply defines the Shortest ine taken for executé gz POSS a ere 52 TO ETRE EAR AO UCR Laso ary pes Yeoostant & pace 2) linear space. Constant Brace | Constant Space ubed to dezine particwar arrount of fined Space geen to the algorithm. LAS fhe fottorstng Shows | int sqrt Cint ay \t Q=aKxas, return a: ¥ Space Complenity )= O's’ tocar Space Compleatty “ ene Space Complexity defines variable Spaces. ‘beved on datatype thar Be ured to algorithrs as toe at’ Control ico i S AMS the following shows: | an ord int Surmlint AL J rint 9) went tot Sum, fy s ' " jor (7 See Sum: Sums ALLY Ce ‘ return Sur 3 j 3

You might also like