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)
44 views
C Programming Notes Part 1
c programming notes mechanical engineering semester 1 part 1
Uploaded by
Farhan Masud
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-Notes-Part-1 For Later
Download
Save
Save C-Programming-Notes-Part-1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
44 views
C Programming Notes Part 1
c programming notes mechanical engineering semester 1 part 1
Uploaded by
Farhan Masud
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-Notes-Part-1 For Later
Carousel Previous
Carousel Next
Save
Save C-Programming-Notes-Part-1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 24
Search
Fullscreen
opetrahon Procedure Hebert Gchildte—_" Teach Yourself © ScHADM SERIES E . 0809-2619 ak Computes:- A device that perf hems calculation. a reo — LL input | [ processing | [output | Y v Command Foisow-up 40 cornmand given execute executed - command GF > Processor: 3 An electronic device That solves all Kinds 6f' problems > Works with the help of! othee parts cthad => Monitos:- certain space os place Where many informahon can be kept > can be Used te Tesehve various programs. —> When any program is inihated, it 1s loaded in the memohy, Then, the processor @divks with the loaded program S Ik is also called vandom access memosy (RAM),> input /OurPUE Device 4 => Secondary Memowy ‘- <3 Progteamming 2anguage = > computer language 9° expressed in banatry system. Using and Log: and () ame catled > Assembly language “se Cessemblen vosed fo convert ten in. assembly Lang. assembler. binary sole vairions imposte —s mechine tangs) nt words pox mal, aNSe Ls progtameione wor it and converted to machine language ving 20 => Computer and interpreter: <> computes, and aptespreter issvsed) fo convent source code into machine language. compucte s erated . machine code intes pee ter Soutrce code> eympu ter converts Souiece code jnto obgeck code and file 4 add some helping ev needed, ty give tresutl as advantage of the code is thal jb cans be used direct ly without any helping Tile next fime <> Interpreter executes The instructions one ne af tes one line and never converts The whole prrogtram altogether. >! ‘ compiler is faster than ointes preter: 7 D> Working phase ¢f a compiler Source code bb ‘ elechricalsnprt analyser Csepeirote te 1 , > ale Syntax! Analyser Ehack ntaw) Cibtingsq ie Reefer v . | Sementic Symmetizic analyser ¢ : | Y ’ 4 intermediate code genetator 1 , code ophmiser | ¢liminots v object code.p fortran c = READ gatechanc) | ger) || sean C ) | WRITE | Print () PRINT | Putchan ( ) | putcy It#navaniees of c~| > C ie called medium level language. It has gor the advantages of high level language and it is atso Similan to assembly language, PC is a stiuehtired language. 1k can divide large Progkams’ ‘ints small pairts. In every email pants different data Can stores be declaiced Peperrately and every in every panty Seperate imstkuetons ean be given. > In Case of c, while, do Bhileete, can be vsed~ PF Caan work with different operating systems,+ ¢ is a combination of high level and lewd level + Opeteati ons +Vanious loops | | | 1 Siw Pregey some | | | | + Sting ' + Poonter fae V'Siridetute ® *" ; | | 1 i |" uso F/Row — = Binany A Ase Ase tT y a bit in binamy =5/0’ and ‘I’ > these hoe are called system = 8 bits ave used ft make a new unit Which is catied byte = 1 byte may have £76" and § ‘I’ on thei Combination, - Se 1 byte con be represented in 2° oy aoe ways. ASCLI D> ASH stands for Ametrican Standard code for information intere hange ASCII D> In ASEH thee is a fixed number for every alphabet ox character of ch computer > When ony button is Pressel, computes gets the ASCll Code of +he characters.integers (continued) 42) = Integer value is limited fp the vange =32968 bo 32769 > Signet Signed integer uses one bit for’ sign and 18 bits’ for magnitude 32 dit integer vanges from 2147483646 to RINT 46 B49, Snteaers can be Classified © short Integer a) Signtatesea Noma} (3) Long Integex into 3 types:- Integer. > shont Integer Requitees half the amount of storage aS 8 Reguiai number integer Requivees, Saned CS tpg) Integers “*MSigned (94 Drange varied Extra Range can be vanieg by COPventng signed to Gnsigned vatue Viow modi fier /qualifiermagnitude. => for unsigned, range is!- Fo te 65,505 (unsigned ints) +> \nterchanging unsigned integer ali bie ate for! |19/09/2019 Date Types [continued | (@) Foat Point - > Flocting numbes ahe stored in 32 BI with € digits of precision (highest 6 digits efiey decimal) => Among the 32 bite, let 23 bits for Man tisse, ext & bits for exponent and | bib for Sign. >> After decimal, highest 6 digits can be stored, S Any number betaeen S4x10°® ond 34x 19% (3) Double Types: (range 4, precision 1) D uses C4 bits With preeision of IF digits. D> fitst 52 bils used fox Mantssa,next 1 bike for Mantissa and last bit for sign, 3208 308 SRange: (pax i) ty gx lo ) extiea [voia is aleo a tupe of date tyre]G) Character Type: aS single characters can he used Dstenred in @_ bils > 1 bit for sign, 7 bit for data SS if the sign bib is “O—> positiw. If the Sign bit is '1' > negative = range Gias fo 7) [rer mas sange] for unsigned (o-a5s) WONT & Data type:- That change Cintonne & Nu mere’ ees Numeric chateacter constant a Spteqer tonstant % types of integeies ~y decimal (0-9 digits) —docta) (0-9 digits) (0 at first) > hexadecimal, #9 eReal constant extreas-[mumbers Containing freactianal pars | 4 0-65e 1asee-a .. oO be +5 31e3 aren oineté no void space .How Jo convVERT @ fo os nocl] value. ascll OF value | Chateaeter constant A Dngle character constants sp containing a single thatracter enclosed TOR WIT hin & par of Single quotation mare. Ho Siteing constants. “PA sequence of chatacters encieced in douste quotes, % Characters may be letters, aumbers special charac teres and blank spaces, > A single chanacten Constant is pop equivalent 4 Single character sting constant. extra Mus} always be Mone than one for ctring constant « chatracte rEXTRA we Data type Vatiable - which can change Dany/character/ name can be used. Gut the first letters Cannot be @ Dumber, => Any special character (M, @, &, +,~), punctuation charaeters (%) ean nok be used other than. underscore and dollar sign, $ Var, van-2_(no hyphen) Vv x =) Blank Gpace cannot be used sin w variable , =} Key Words cannot be used as Variable name. =) Any number
integer) Value “Ae-> Floating point} incase if exponenhar form is used ED 8 " Wuis . ” "2 0-> octal string l< “ZS NUL tenmina ted chareae tery, %U> unsigned integen ‘AX S hexadecimal ehin tegen ~XD> « be single quataton wei, 7 means char print ("“%d", a); pein fen Zeek) % 4printé ("format specifier”; veriable name) Sif there is moe than one satdoble formal specifier, then assignment of Value fp vatdable etre stae ts from the raghk Yateiable and finishes at the tess. aay, bb print¥("a2%b, b> 4a", ab) aa, b=6 a=12 a=% geading slants from teight to lef “rt 4 print? (“Zd, 74, 44", a, a2 015,0) Deculti- RIT print OC" %-d, “a, And” Lo then reading is from left to teight cy how Tony spaced after decimal aprrepe_L pat printt C'%82 6", a) v & denotes fetal no. f digils= H-$8909, be 4I-LIDEY, C= 400.9994 print # ("xz gap% @aF 4636", a,b,c) Loan aed prinig CJ BFA 83F" abe) B88 fom «o> . loa CBN ON BN") Qtaing taseseet-address operator 23/04/2019 * iS an ad bean? i address operatey food sean ("Ad " 00); 7 Y.§ Floahng point furction =) & is an address operator. feequiked pret 8 ecanf only, = addiress operator noi scant ww ingide double quotation 16 sheing! —— : [Symbolic constant | (ats most be in capital lettev aways) # define symbelicname value of Gendtant og names > symbolic veteres end are sometimes Called constant stentities identifiers names Tureen we have the same form asivatiable! names— athe blank space between # and define => 4 must be the finst character, = a blonk space hequined between define and symbolic nameAdvontage of G> Many opera tore can, be. used Opera tors:- 2907/2019 I =A symbol that felis the computer fo perform centain mathematical 9% logical manipulators used to manipulate data and vatiable and fotrm o pairt of the mathematical operation. extra) In C-3 modulus 9 gives Temainder gf divioyons. % > cannad be used With Fioating point dete ~> used with integer only. iW sS4e both the opeivands jn oof ahithmahe operate . integers expression ate -beteoeen then the expression Is (called ovr A : she integen expression and operation is Called integer atithmatc, =A Integen atithmaHe always yields the integed value =) During integer division, if both the opehands ate, oF Jhe same sign then the mesulb wil be. trun ketted fowaivds 2010, If one of them le negative, trenkatien may be eitheo ways. he) Durting madulos divsion, Sign oF the respi is alway’ the sign of the operate. o fitest operandan i aie tzat b + airithmatic integer. @ This means.9-t4'e 3 = -2 1477.73 =a fran kation means eliminating oomething. operands => An atithmatc expression involving freal operations is called veal anithmabe. => A heal operands may assume values in decimal of in exponenhal form notation. not => Modulos opeiahons can be done with veal operands,fipat dala has mone ™ by tes. float has prriorerty. Cc se _pezintegen 4 floc a Swhen one of the apeland is veal and the other is Integex, the expression is catled an arith matic expfression > Af either operand is of veal type, then only the | Teal opePahon is performed. Foe manipvlation of :— chat. & ink, => int Shot} int. # int-=> ink ine double > ddvble float int — float fe, ‘ Float dovble-> dovble. 4 < cast type > operand —9 data casting opeirater. 1 X= Link>a if a= 7-5, a will be assigned as Din x, ine us Lintd a /Lind b> PB A es, ce be float ib i nod asvig ned a and b wil) be Convested to integer.29/04/2019 Relational Opeixatoy Caused for comparisons) (Decision making opetator ) D> The expression containing a velational opeiratey 19 called relational expression S The vetet value of relational expression eis either Zero oF one. ¥ 4 fatse fue <, >, 45, >= FoRMaT oF RELATIONAL el frelatonal operator ae 2 OPERATOR, ae arithmetic expression 4.5 Le io (True) —value Will be t 4.6 S-t0 (F390 ~35 >= 0-40 AD LISS 1 ath
> de <> >= S=ols JS nok operator changes tyve of false of velationa) opetrator. 1 (ay b)-> depicts a is not greater than b. 14) 1 (a>b)— adeeb VCagb)— apy=ab 1 (nlsy)> x= !(a=zy)> al=y x xAogical opercator Riga oa al ar6,b=3 ttt0 f=10 Gyatbci 314 4 4 (start freom left) tyatbei (iva) + Gai) = 1tte2 v plus makes this entre thing an axithmahe expression: Or else, the value of elahonal expression ig always Limited te © ov. ¥ Logical opeiralor (Cs used When Making comparisons), > An expression containing hoo oF more velatonel expressions is Called a Logical exprescion ov compound welational ex pression.cal operators! — logical AND JH logical OR — logical NOT '@eb uaeza) Los! Cnot zero). !R> 1130 INS et (asct no- value) =o 1o-g = ogee G d-ge t-1a=4) | LEGS =! Clotigy = Ware lot Logical spercators. (ans) 8 & => In case of legical and, if and only if both the Operates ane tue, then the value operands of the expression | is Hreue (0) or else it is false (4).
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6125)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (932)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8214)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2922)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Toibin
3.5/5 (2061)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2619)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2530)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
Exp 01
PDF
No ratings yet
Exp 01
4 pages
C Programming Notes Part 3
PDF
No ratings yet
C Programming Notes Part 3
24 pages
Maths ODE Part 1
PDF
No ratings yet
Maths ODE Part 1
24 pages
C Programming Notes Part 2
PDF
No ratings yet
C Programming Notes Part 2
24 pages
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Yes Please
From Everand
Yes Please
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
Exp 01
PDF
Exp 01
C Programming Notes Part 3
PDF
C Programming Notes Part 3
Maths ODE Part 1
PDF
Maths ODE Part 1
C Programming Notes Part 2
PDF
C Programming Notes Part 2
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel