0% found this document useful (0 votes)
2 views25 pages

C Language Notes Chapter1

The document provides an overview of the C programming language, detailing its history, structure, and key features. It explains the compilation process, variable types, data types, and operators, as well as control flow statements such as if-else and switch-case. Additionally, it covers the significance of keywords, comments, and the concept of type casting in C.
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
0% found this document useful (0 votes)
2 views25 pages

C Language Notes Chapter1

The document provides an overview of the C programming language, detailing its history, structure, and key features. It explains the compilation process, variable types, data types, and operators, as well as control flow statements such as if-else and switch-case. Additionally, it covers the significance of keywords, comments, and the concept of type casting in C.
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
—C Q talhat ig C Fepege Full_explainatien- ws Cis _o middle level ‘proceduvel Oviented Pag] worn lan. e developed — Debnt Rilchie "of AT’s 4T_ bell labovatovies in the year 1942 in USA: 104A rOMiNn< Note — OC isa Compiled lang hat pregnan 8 —_covittens in Cave translated inte machine Code befeve they ove executee hy 0 Compuler- nyuage 5 tohith means we har oO > rrelatively Smell Set of Keywords Ond Syntax Yule, cohith maker it a Simple i te_leavn ond use Ww) C16 algo Known for ite ‘peatabilly: a OF C_lanquags lsequey ' _ 9 ar Ritchie Created Cos an oxtenicn _| of B Yy ‘rommn Jane “yt »uohith wag | ae a q 9 Simplified vevsien of the a GN ypoy ye lO “The _ynain spurpese of Cu das te_develep the —._Unix Speer fo = ot Bell babe K _O The fist _vevsin of C vos . Bato DEC _Ppp- M_Computer cama the UNix — Pye Syn TIS TE wn awh (led "New B" but wee lotr venomed 'C”. [gt C2 = le Cleaner offers Sever. ple —|—_ Effie i » Pordelil Yee |) F lexibitidy + - | Ey w) Mo dulavity- a= aa ___¥)_ how - Level arming EL “Wi Sim plisily. i 4 Mi) Easy te leave re. rer | to Le heed a Compiler that Can translate the Code inte machine Code of ey haf yma che Code ereculed by O_Computer: ~ | test Commonly Used C_ Compiler !— — ——o Lice — = po Clan __ = b | > Michbsof{ visual C++ |—_ Turbo C++ oe | Struehire of _¢_langu ole “Documentaken MM Vine Cornment Ft) Pile declarations 1) Utlolal de clarabin; AY) Cxersbable declaration: _— L a _ Hinclude < $4 dieshs | int maint) Ld pam Chern Coding), 7 yehurh 0; —, Compiladisn Exeeu tin process of Cas Peeper riphe (Sure Code saith -C_ extent) CI Pre prmcate (Linke Hea dev filer ) Compiler — Fist. obd + Linker (2d objet filer & libranze) Fin. exe hgades (Lond load sere Sile ) Pres yam 1 OT Rnned label 1s Vawiable? full explainalisn: ee Variable ig the hame —of memo locelin —voheve _We Stove _ dota,ve trieved Cihd manipulated gz 2) the we "§ e@recufish: _-|Notei- A ie declayed with O name ond |_| 0 deta type » — a Ey Gxramplei— - ___datalype Ve ee | iat a . Lol Rules +e _declave a varieble -— DD _Vawable ame must stort vaith a letter Ceithey _upbertase OY lowe cate) Ov UnderS cove a Variable heme Can only Confain letters, ae Ond UndevSteres ——— _ wt) woe Can't give extya ee __Nayrable’ pain [~) Vomables ove Case. Sensibin Ine layguage \ rer a Ty pes of Vowa bles t= © Jocel variable In _ “|-A_vowiable— that is declared within a ___ tb block of Code - | Panchen ov o \ | Nett olt Only crecessible 4 sittin the Panchen the funchen | block Cram ple!— ®D void fined int xe t0: I local variable gL | WD if (eonerben) - Pe) + — 3 = lor | variable T Cry C? ~@D vilobal_variable t= A Vawiable that is cleclawed oubide of Onny Panckon oF block = Neko It Can be accessed Ond modified Bre ws m' os ! Cram ple = int x= Mod odd) — RX _ void SabO) a print $A", x): a aL @=-— ,-—_C% iy E 9 ans D_Statie_vorrable i— FP _venable thet rretanie 1H ko (El 2s, ester ira “Mote !—©) State Vaviable ay ere Once , omd itt value 1S 4pve Served Until ‘the end of ae | cs fee yes Fane ie a Stake’ _int Comt=0, —_— font OO, Count): Count et, - 3 ; a jo EEE = fun oe Jit inet ae _C_?. in ea bet Q lathet_is datatype? fai erplainakin: Bos Data _Lype _defmres_the ype of value wo Sbeye | Meare ohat kind of \ ice vamialle | IS Hoe x hel —-- pet va psf _dta ype == LELELI HH H | CLigpramrieg —— ~. Pumey — Desesiphin __ Se nt Used Por ‘integer | 4 bytes on most —_| =t = vaives. of the Sy ten’ ~ Plont | Used Foy Floating | Typically + bytes. | point Valve wail = precisisn: | | aewble [ted for Flestey | Typically # byte | oint Value with Oo) = double precise | — _chey | Used Poy Sinale Typically 4 byte - = | chavahag - | Wid | Used fovto reprsmt — |Typially no sige | at the absense ote MF 7 4 type - _ | cp _— = Le Nevo Wein o Ahat 1 Constant 2 ful explaination: rs Corstant iS nothing but a valve thet _Comnet _ be altered by | Step ™ eis MS crew tin - + —— Cram ple = ~ Cont int imt_x» 10; ct nal is o._keyoord Nate! OD Com tnt Can be ot = Sch ag int @ Mahal is identifier? Fall_explainahen ys> idenlifiéy ‘refers ts the name that it wed to__‘idanlifie vawabler , Tunchsm ond on. Nake Re can't tse Kequdoted as OX idendifien. _Ceample =i) int a= lo, 7 Ls Hove, ts iden fifi L Dot Pb A fun 18 0 identified » 7 LI my) tnt ant et" > _ tn valid —- al fra noyning C_Pre het 18 keyword 2 Pull etblainaken dy keyoovd ‘selling bt nrelevve. —_ \ Peat i —Saltendy Fined On Compiler. a Note? CD We Can! Ute _kkeynerd of a = Vearfable name , Punchisn Wmes Qe int Float =1/ SSS WL ty tabi © keyword aun reir [ney oe OM Cy Ge have total B2_keywordt keyword fish == a ante — ___extem Sire of = ie break. float eco = Case a eae ia _ thay — [Cohat ie am ‘ape | Combine — nh nt — default = Unsighee! oe\fistey Vol deuble MolaHle else Shot crm 89h @ What 15 Comment? Lull erplainakens yr-Cormots ove Used eal nster oy d —exploinafiong 4s the al +H totals hered by the Compiler ond pile oun do arta y affect y the Code enretatsn- Ere ose We Comment I= —) wake Code move ‘Yeodoble - Ty | A) eentsy hs eevee w) Aad alge ati _leteil explaination For a _ovher me ment who vas mend The Code E a a as! el het <__ | is a ae L Angle line Combwend — Z a a _ [ [ito ts is er x Grangle— int alo; | O18 a vevieble, | Seapaple =e ae See zz + Foy odd | 52 wombs +/ rt ay — a [e_oveite Sxcette pregreen == Hoe —feviede No b “ 1. WW 0. type “eal 2 LA explains dein ‘bse Bype Casting ig hothme Iyut pvocess of _ Corverbing o versbl From one datatype —_ 4 another: oo L = | aaa wt =I! —_ - i Float b = (Float) a ~ Mate = Ht used when uae aninn _|—_ Ore datalype + a ‘ona oe —_ - | Mrowtable , it Can resalt in "1 sf data te aweid Yt -preblem Hp Oey Cowes rte He apithass a “Indhet 1S “token ® fa enpleinabin _t @-— Bye A_teleeny $e owe nothing — abut Smalls nBvi deed unt of a Qopvegeam thet 1S meniny al ste the Cainguler WNsh "© Om be a keyouds ideally 4 bev, Cons) ng, uk Skt cee et mm pov tant — Be case .C Compiler sprocaser phete +okent to_undeshert the Shcbwe ov Syntar- T 2 Pull explinaben. ~ 1S Q Symbe Ast aperfomt oa Operationt On OW Oo peren Sf ___ _t ariclles ov valuer) . = = Cc aap a wo Paithnete Opaahr, — > Relalecnal opernters = peg rdal Sfreractee s _ | pent Ob eatr | jnceement da Crement Sperber: Ternary | Spender + _ ithmetié _O beve bey 3 — Dvithmelie opera dor dpe forms Ovi thmehe - Operabsny oh numartind valor | Ganplei= O Psy ben CH) - - OD gubbrachin (-) = © Malkplicntesn Ce ) - _D_ divisisy CW QD Module ch) = — D Diets then ov equad Ce=) S pix? Operator 1—_ 1 cok spender iS ed te spe Porm L ogee? opermbing 0h poolemn Gramnple = OleyieP AND Cas ~ a ef oR Cu) OQ 62 wer C1) LL TI DD ment Obervapoy Ce ae LJ 2 Varidblep a » agate! —_ 2 Astignme oe) © pau went (4 = ab tra ene _ Crs) gu C fe) Anert (f=) ete © Incxenend 2 peeved eetnby i= _Olhcvement Operator i= Increment oberabey ‘18 Sted to ‘ntveate the vakue FO vomible by ove Grangle — nt = 5; “Taber _| e Pre increment (+4) | post — ‘increment C144) lo Decrement Obevater im et I) now, i has a valve eof 6 Decrement operator 18 used be de creme 7 : the value sf o ventible by one = - Pre- decrement b)? arb; _____C_Programni — @ What 18 Conho! flow 2 Pill erqlaiadies a Con bat Ffouo afew ted the ov Jer in hih — the tnshreetesny atin are _eneeute J - Cohn bel, Cone Bsot—= — te CondibenO Sfatement ce “Trani ber Ss foment Cl Hevabive stafened » a D Condisn.d statement : 1 Com Ji ben Statement tething Dud otlesd a preynam La exerts or Tearan bleck L Code omy olen A carta comdiban =e tre, Theve ove Several Lypet of Cr dibinD State meit = L “© 1f_Shtement — H erecaitet 0 block of Code only Lon Cet bein Cok di hin ~Oif-elie ShdemenFi— H 18 Sed AL execute hoo Stetiment either EF Statement OY — elte —§ trdemaxt Poy aw a Ron difin. — — “ Syptee = Butta : [> aPC eon diten) x Il Statement 4 [oebe x | His I] Statement Q 0 elect _shttngt = - OS ~ th elte if we cm gre rnlible Con tbe 7 — bat ata tine a bolock ih fe | Create | - — | Syntace iF Coan ditn) __ ee =a oe 3 - ee | _ ele if (com dikes J ———. 4+) ex — _ a 7 | _ 7 Fre om AW csez |__ iF Statement se eabine anether if block tathenevey we afte If Steftment Inside Hos Called nested AF 2 oo —, Sypntee APC een dittnd Oo a — [ce ee a © Swirl oa totement ) Switeh —Shlewed 36 hetking Ju pal _ —Chatte__Salebion — Strtement at sneant —wohen se unt te Se leet ony One Case out of _ [ 4 a + rrulHple ayers break; te 2 Sateen ! rer; 4 — [a | Cate bt Slatemest bh,” break? tate deat Shaleneet - 3 @W) = a \ 2S VransPey Statement tL —[ Sig Sh Stotement Isa O Statement 2 Can Conde) pe oy different “= rer re he ro = —t : ai L4 Date DW bese GD Conlinte relurn oe ‘HS Used 42 fyantbey Conte! docx labeled Statement soithin the Bame Penten a oe Santer = le Iobel 5 ss — sb is 0 ideabifier. L & ler— main) 7 - Geaple y L cit Gey je =. labels —_— — | i “earn Coding") * a L itt; CT af (hee 5) - Ly XN : = label + - at label, Lt 3 _ : GPa premnyey “OQ. break I= break bement 18 a Conhel SH tement ured te exit fem oO” ped the — | Grom ple Pty tessciaa) TT ff Us=s) 9 _ cbreak ; 3 print am 30 Jl oubut =>1234— D Condinve:— Continue toed # 4. Skip the E Sperm any Atabement? ‘nide oOo Omd wet be the hen | the yabian of _ le t= For Cie be =162 ine) Grom! s - “if Ge=5)8 3 Continve » -I winkf Osi) _ - 3 * - Hoty S 123461434 Jo — —® ~ehuyn — yehon shed 18 ued de eit mile Panchen ond vel a value = tothe Colley pont: “I -Scanple spt etal int xyint y) = 3 yelwn vty am mm QO int Yebulf = aed (19 6) | prt OUI vert) - 7 , 7

You might also like