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)
31 views
C Programming and Data Structures Notes Sample Compressed
Uploaded by
Prince Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-and-data-structures-notes-sample-com... For Later
Download
Save
Save C-Programming-and-data-structures-notes-sample-com... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
31 views
C Programming and Data Structures Notes Sample Compressed
Uploaded by
Prince Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save C-Programming-and-data-structures-notes-sample-com... For Later
Carousel Previous
Carousel Next
Save
Save C-Programming-and-data-structures-notes-sample-com... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 8
Search
Fullscreen
if C is a psoceduval penne dengue’ i 1» boas Initially evelopect by Dennis Ritchie tn the years at the Bel Telephone Laboratories to develop the UNIX yen systen- G Programming is consideved as the base for the other Paogramming danguages, that’s vohy tb ls known as mothers language - C language is the system — psogrammin danguage because it can be used to do bow- devel fram : Tt ts generally used to create hascwave devices, Operating dystem, dvivers, Kernels ete. The main features of the C donguage Includes dew - devel memory access , Q simple set of Keywords & a clean style Tt ts used in dot of scientific Computing Uke AL/ML woeathe: secasti ete. Clc++ code ts very faster than a code toritten in qava Python. . ff: ME Cc teens ave the basic buflding blocks tn ¢ Aang. C token ave the smallest thdividuals unit. © Keyroosds © Identifiers @ Constants @ Operators @ Special Symbols[Keyword ee wosds axe predefined & reserve words 4 prede} used in Programming that have special meanings to compiler: (nt money; Herve, tnt ts keyword and money is vartable- keywords ase auto. break, chat, Continue , default ete These ave keywords tn C fongu e- BO Tentigtys refers to name given to entities Such as vaviables, functions , structures ete. Tdentifiess must be unique . as oe axe create! to give a unique name to an entity to identify ¢ during the execution ete som Tdentiffves names must be difjerevit from keywords. @& int money 5 Hese monty 4 acountbalance are ot double accountbalance ; 5 (Constants) WE A constant is a value that can'tbe changed tn the program. B® dectrmal constant -» 10, 20, 4So ete. Chasacter constant — ‘ah? ete, Octal constant -» 021,033, 016 ete: (Operatovs |) mG ar operator is simply a symbol that is used to perform operations. There can be many types Of operations Like aytthmeti, wogtcat, bitwise etc. Arithmetic Opesators [+,-, ¥, / ] Relational Operators [< <=, > >=, ==, I=] pevators [ ££ , il, } J Tn Programming danguage, the Special Symbols have some special meantng and they con not used for othes purposes. be GPO, t. 2, ote { €xclamation mark — Underscove = Colon # Number sign + plus sign * semicolon ele Pescent sign > comma Quotation mask Ampersand / slash ? Question mark * pste risk Equal to sign * Period.Ware program basically Consists! of the following pasts — # include
© Psepsocessox Commands int main) 4 ® Functions [*Ptyst program */ © Variables printf(" Hello , World |\n");, ® Statements & Expressions return 0, § ® Comments det us take a Look at the various parts of the above ‘Hello , World!" Program — The first Line of the Program #indude
(s a pre-processov command which tells a ¢ Compiler to (nelude gtdio-h file before going t actual comptlation- The next line int mainc) ts the main function wh- -eve the program execution begins. & Tre next Une /*------ *7 wlll be ignored by the comp- -tler, so such ALfves ase called comments in the program BGP The next Line printfG--) ts another function ushich causes the message “Mello, World!’ to be displayed on screen. IG Tre next Line veturno; terminates the matn function & returns the value 0. aS © data types veders to an extensive system used for decloring vasiables ox functions af diferent types The type of a variable determines how much space it ocu- ues ln storage. B& dijferent data types have different anges to steve nos. W® Pasicatly data types ave of clifferent types — ® Primary Data Type (char, Hoat , Int ) @ User defined Data Type ( Enum , Typedef ) © Desived Data Type ( Pointers , Axvays » steuctures , Union )known as fundamental data Ne Speifier types because they ave pse. aa defined in C Aanguage- i “hed ie Psimasy data types in C Ke | ase of 4M types + tnt , chav, bd oat & double. 4 double of Uf (INTE QB Tre int dato type is Used to shore integer values. Range : It can be Signed ot un signed Signed tnt— + has generally 32 bils CU bytes). Unsigned int signed - The chas data type ts used to Lnibblee Ubits stese the chavacterc~ WF chasacters must be ingide single quotes: ifn usually 4 we pony: Whenever we entexy a characler type variable, the chara- ~cles is stored as eyes Value (in the Address Locattors J a ne float data type ts used to e€ floating point numbers. The numbers that have a fractional past are called oating point numbers: Range: ar has generally 4 bytes + These can wepresent @ much dager and wider ange of dlgtts as compares! to integer data types IBLE | 0 The double data type is used to stove floating numbers . Tt occupies twice as much memory as float data type. Tt has genesally % bytes Range: int - 10, 20, 30, 100, 1000, 586 ete Stove OHO = al scito NU", Mn at Sin, x! A NG tok Oe iets Hoat - 0.7, 0.33 , B21, 6-43, 1000.29, 562.0! ete. double — 32.334000 , 14u.469B300 — eteita Ty ie Enumeration Cenum ) ts @ user defined data type- CBD \-Enuvn datatype Tt is mainly used to assign | # include
names to {ntegral constants int maint) £ Value Ossignec! must be tn range ehum etter Fab, dP} Of signed tnt. enum deter gy: dy Sgntaxs! enum enumnamet 4; | printf (dT y); Pea enum enumname + seturno; 3 i Specifies whether to Intespret the Coxsesponding argument as a Chasacter . a stsing, a pointes, Qn tnteger or 9 number. ee ; : Hcled| signed int It ld | tong tnt || eb | Potter bu unsigned int — “hl | dong Long tnt +g String bhi shlu | Unsigned long int “I. X | Hexa decimal hu “Hllu nsignes Long Leng int ko cata Integer a A variable (5 @ name given to Storage area that ous programs Can manipulate. BB rwasanees UF Too main Concepts of variable; void mainl) @ declaxation int a; © Initialization & Usage Q= lo, Nastable name starts with owes cose ox underscoxe (_)-. BF int abad; + declasing multiple variables tn single line (nt ass; int bz5;—> decaying 4 tnilializing variables. je A constant” is a value at can’t be to to 5, value ts Q=5; FAvaried, sol ts changed tn the program- @ Chev > ‘#', Qik ROME hes BO Fires chor, sizing. integer| ‘abe’ > X alot a chav weal valued » St SSS a tmpty can't be @ String> “GATE”, "Book", that “India is my County" | % —> X Not valid. must “Newton Desk ” be In single quotesES an opevatos is a symbol that tells the compiler te_perform specie mathematic TIC OPERA SEZ ere ae | 1 | + Adlde tion operands. 4 | ___Subtracts second sperand srom#first:| * _ Muttfplies both operands. _| poe Divfoles numerator by de- num’ | 7° Modulus operator and xematnder of after an integer division: | ++ Inexement operator tnereases the | } value by ones = sill ement operator clecreases the [nteges value by one. | Checks if the values of two operands (ane equal or not. Cf ves then the. Condition becomes trie, lye | Cheeks tt the vatues of troo operands | 1= | eve equat or not. I} Ale, then the. Condition becomes true- i TH e of wunch ts Grea- | > er Bran nese of ig oped | The value of let opesand is LS | Gass than the valut of right operand: “The value of Le$t opesancl Ls greates than or equal to the value of | a Lriant operand: | than or equal t the value ot 1 le “ value of dept operand ts lese | | right operand: or _dogital functions. int mained § int a=n ,be4; print? ("Sum = eecl\n”, arb); peintt C' Diff 2 d\n", a-b); print (" Quotient = “d\n”, ala); pelntt C Remainder= 7c \n", arleb) paintf C'asvd\n" ++); yetusn 0; int matnu) § int a=12, b= 4; Py dSgreatnttanns/eol \n's Qk); print? (tel is equal te-Ad \n"ab): i$laj=b) printé Ud ts not equat to ed \n? a,b); welurn 0; la>b printf tela.Ops. Descexfption Logical anins> Lt both the 4d | operands are NON Zero then | Condttions becomes true- i | Loptead ot > ZF any ef the two eperands ts non Zero, then cond* becomes true. Logical NOT Tt ts used to weverse the logical state of NOTE # True rl j Falsero Short Cireuit incase of £2 > NU there ts a condition |@ryohere tm e& pression that — return false then yest of the Cond” after that will not evaluate er fn expression that yetusy fue then rest ofthe condition, 48 operand. after that will not be evaluates -0aen ~ ~ a ‘i % BITWISE OPERATORS a) ae (aor Tasce 3 aaa Beene ene Pag Opa: art oa RAS ete ail o o ° g Btnacy AND-> Tt copies a bt fo 8 g to the result ¥ Ut exib fn 0-1 ° J dt ceslelon as ae | \ Bihasy OR» Lt coples a Bt YY , | || exists tn efther operands. | i. = i). | Binaxy xoR—> Tt copies the bit Une) : | oth bitise Left/Right shyt shot ceae ie AS. sper the trailing anel tedatng eS Binary One's complement» Tt hag Pos? are ‘Hued toby, zer0e the ctect of Sipping bits. ce “|Binasy Lept shift >The value. ts es movecl Lett by the. numberof Descziption 4 Heal bycrd plates peeavid 3] Right shifting is equ [| Blniy Aight pee me aspe ae oe >> operablal SUS area aight by ee don 4 ae ie the no of bits specified. Blt Opes Assignment op’ > Assigns valuu| = pt -xight eed Ss seat aig to left operand. Bp d |Subtract ahel asci PrENE opt | and assianment -= | Lt cubstracte srg oper ruil ga jand. assign t kept operands | operand & assign to left_ Divide ancl Assignment opfs|| Modulus and Assignment opt ‘= Tt olivicles the Gee opera) ¥j,—| Tt takes modulus using too with the sight operand 4 operands £ assigns the result pessignis’ ope parol Le epee Left shift and assignment op >= Right shift ancl assignment opt: | Bitwise and assignment: opr. n= | Bitwise ex-oR & assignment opr: Bitwoise oR L ascignmert opt S ) Retusns the of variabl Returns the address of vasiable- | * Pointer to a varfable- Sizeof opERATOR [size OT ya OWE sicck, operator com- ~putes the size of variable Coyte)- ae x ts a unasy operator. For float values use dike this Le io2F otheswise ft utll be treatec! as doubleCio2) oF use typecasting for float and cloubk. BE for chasactes data type ie char values” use typecasting or dfrectly use datatype ox variable- Operands can be variable, constant data pe size of (x); , sizeof lint); , sizeoPts); Civeecasteng Jy /gle Lt refers to changing an variable of one dala type tnto another. BS me compiles uafll automatlealty change one type of data tnto another (tf [tt make sense. ag Types» ‘EMPureeT TWP reXPLECET ~ TYPE” @hWhen the type conversion is perfor-/ ® The type conversion performed -med automal ically by the compiler by the programmes by posing the wolthout programmer's intervention clata. type of expression of speefHe Sud) type of vonversion is kneaon type ts known as explictt type as implicit type eonversion or type 7 _eonversion- romotions tnt x; for (X=491; x<=122; x44) intx; ete For (1291; xee 1225 X44) ies ol Svinte Une", (hav) x); 0 \ t Tate Coc! x); j
You might also like
Hourglass Workout Program by Luisagiuliet 2
PDF
76% (21)
Hourglass Workout Program by Luisagiuliet 2
51 pages
12 Week Program: Summer Body Starts Now
PDF
87% (46)
12 Week Program: Summer Body Starts Now
70 pages
Read People Like A Book by Patrick King-Edited
PDF
58% (81)
Read People Like A Book by Patrick King-Edited
12 pages
Livingood, Blake - Livingood Daily Your 21-Day Guide To Experience Real Health
PDF
77% (13)
Livingood, Blake - Livingood Daily Your 21-Day Guide To Experience Real Health
260 pages
Cheat Code To The Universe
PDF
94% (79)
Cheat Code To The Universe
34 pages
Facial Gains Guide (001 081)
PDF
91% (45)
Facial Gains Guide (001 081)
81 pages
Curse of Strahd
PDF
95% (467)
Curse of Strahd
258 pages
The Psychiatric Interview - Daniel Carlat
PDF
91% (34)
The Psychiatric Interview - Daniel Carlat
473 pages
The Borax Conspiracy
PDF
91% (57)
The Borax Conspiracy
14 pages
COSMIC CONSCIOUSNESS OF HUMANITY - PROBLEMS OF NEW COSMOGONY (V.P.Kaznacheev,. Л. V. Trofimov.)
PDF
94% (214)
COSMIC CONSCIOUSNESS OF HUMANITY - PROBLEMS OF NEW COSMOGONY (V.P.Kaznacheev,. Л. V. Trofimov.)
212 pages
TDA Birth Certificate Bond Instructions
PDF
97% (284)
TDA Birth Certificate Bond Instructions
4 pages
The Secret Language of Attraction
PDF
86% (107)
The Secret Language of Attraction
278 pages
How To Develop and Write A Grant Proposal
PDF
83% (542)
How To Develop and Write A Grant Proposal
17 pages
Penis Enlargement Secret
PDF
60% (124)
Penis Enlargement Secret
12 pages
Workbook For The Body Keeps The Score
PDF
89% (53)
Workbook For The Body Keeps The Score
111 pages
Donald Trump & Jeffrey Epstein Rape Lawsuit and Affidavits
PDF
83% (1016)
Donald Trump & Jeffrey Epstein Rape Lawsuit and Affidavits
13 pages
KamaSutra Positions
PDF
78% (69)
KamaSutra Positions
55 pages
7 Hermetic Principles
PDF
93% (30)
7 Hermetic Principles
3 pages
27 Feedback Mechanisms Pogil Key
PDF
77% (13)
27 Feedback Mechanisms Pogil Key
6 pages
Frank Hammond - List of Demons
PDF
92% (92)
Frank Hammond - List of Demons
3 pages
Phone Codes
PDF
79% (28)
Phone Codes
5 pages
36 Questions That Lead To Love
PDF
91% (35)
36 Questions That Lead To Love
3 pages
How 2 Setup Trust
PDF
97% (307)
How 2 Setup Trust
3 pages
The 36 Questions That Lead To Love - The New York Times
PDF
94% (34)
The 36 Questions That Lead To Love - The New York Times
3 pages
100 Questions To Ask Your Partner
PDF
80% (35)
100 Questions To Ask Your Partner
2 pages
Satanic Calendar
PDF
25% (56)
Satanic Calendar
4 pages
The 36 Questions That Lead To Love - The New York Times
PDF
95% (21)
The 36 Questions That Lead To Love - The New York Times
3 pages
14 Easiest & Hardest Muscles To Build (Ranked With Solutions)
PDF
100% (8)
14 Easiest & Hardest Muscles To Build (Ranked With Solutions)
27 pages
Jeffrey Epstein39s Little Black Book Unredacted PDF
PDF
75% (12)
Jeffrey Epstein39s Little Black Book Unredacted PDF
95 pages
1001 Songs
PDF
69% (72)
1001 Songs
1,798 pages
The 4 Hour Workweek, Expanded and Updated by Timothy Ferriss - Excerpt
PDF
23% (954)
The 4 Hour Workweek, Expanded and Updated by Timothy Ferriss - Excerpt
38 pages
Zodiac Sign & Their Most Common Addictions
PDF
63% (30)
Zodiac Sign & Their Most Common Addictions
9 pages
C Programming and Data Structures Notes Sample Compressed
PDF
No ratings yet
C Programming and Data Structures Notes Sample Compressed
8 pages
module 1-2
PDF
No ratings yet
module 1-2
32 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
C Programming Notes Part 1
PDF
No ratings yet
C Programming Notes Part 1
24 pages
C Notes
PDF
No ratings yet
C Notes
241 pages
C & DS Unit - I
PDF
No ratings yet
C & DS Unit - I
58 pages
3. DSA
PDF
No ratings yet
3. DSA
70 pages
Computer Program
PDF
No ratings yet
Computer Program
23 pages
lecture 4
PDF
No ratings yet
lecture 4
24 pages
Components of C Program
PDF
No ratings yet
Components of C Program
64 pages
Types, Operators, and Express Ions
PDF
No ratings yet
Types, Operators, and Express Ions
50 pages
CPP Notes Upto Recursion
PDF
No ratings yet
CPP Notes Upto Recursion
24 pages
Getting Started in C
PDF
No ratings yet
Getting Started in C
29 pages
Internship Report C and C++
PDF
No ratings yet
Internship Report C and C++
31 pages
C4 OperatorExp 2012 Eng PDF
PDF
No ratings yet
C4 OperatorExp 2012 Eng PDF
30 pages
C4 Vfsrfa2012 Eng
PDF
No ratings yet
C4 Vfsrfa2012 Eng
30 pages
Fall 23-24-Lecture 2 DataTypesOperators
PDF
No ratings yet
Fall 23-24-Lecture 2 DataTypesOperators
22 pages
Data Classification (Data Types)
PDF
No ratings yet
Data Classification (Data Types)
34 pages
2 C Prog 02
PDF
No ratings yet
2 C Prog 02
28 pages
UNIT-1_PSTC
PDF
No ratings yet
UNIT-1_PSTC
25 pages
Data Types Expressions C
PDF
No ratings yet
Data Types Expressions C
34 pages
C Tutorial
PDF
No ratings yet
C Tutorial
63 pages
PSUC UNIT II
PDF
No ratings yet
PSUC UNIT II
143 pages
Data Types & Basic Constructs (If, If-Else, Switch-Case)
PDF
No ratings yet
Data Types & Basic Constructs (If, If-Else, Switch-Case)
16 pages
Oops
PDF
No ratings yet
Oops
52 pages
BCSE102L Structured and Object Oriented: Programming
PDF
No ratings yet
BCSE102L Structured and Object Oriented: Programming
54 pages
Dex University C Programing Lecture Note
PDF
No ratings yet
Dex University C Programing Lecture Note
170 pages
Pic 1 To 3 Chaptersslide Shows 1-59
PDF
100% (1)
Pic 1 To 3 Chaptersslide Shows 1-59
59 pages
01b Data Types Expressions RSC
PDF
No ratings yet
01b Data Types Expressions RSC
34 pages
IP Lecture 2 DataTypesOperators
PDF
No ratings yet
IP Lecture 2 DataTypesOperators
19 pages
C Unit-1 PPT
PDF
No ratings yet
C Unit-1 PPT
47 pages
PPS ch2
PDF
No ratings yet
PPS ch2
34 pages
Lecture2 DataTypesOperators
PDF
No ratings yet
Lecture2 DataTypesOperators
16 pages
Variables and Data Types - C
PDF
No ratings yet
Variables and Data Types - C
6 pages
C Programming Complete Notes
PDF
100% (6)
C Programming Complete Notes
147 pages
Topic 2 - Introduction To C
PDF
No ratings yet
Topic 2 - Introduction To C
7 pages
3-Branching Statements - if, if-else, if-else if- else, nested conditional statements Looping Statements - while, do-while, for Switch statement - break and continue-19-12-2024
PDF
No ratings yet
3-Branching Statements - if, if-else, if-else if- else, nested conditional statements Looping Statements - while, do-while, for Switch statement - break and continue-19-12-2024
33 pages
What Is C?: Rules To Name A Variable
PDF
No ratings yet
What Is C?: Rules To Name A Variable
7 pages
C Fundamentals
PDF
No ratings yet
C Fundamentals
31 pages
selfstudy(c programming)
PDF
No ratings yet
selfstudy(c programming)
11 pages
Programming and Data Structures (PDS) : CS11001/CS11002
PDF
No ratings yet
Programming and Data Structures (PDS) : CS11001/CS11002
12 pages
1_Variable,Datatype&Operator
PDF
No ratings yet
1_Variable,Datatype&Operator
33 pages
L2-Constants, Data Types and Operators
PDF
No ratings yet
L2-Constants, Data Types and Operators
53 pages
1 Variable, Datatype&Operator
PDF
No ratings yet
1 Variable, Datatype&Operator
33 pages
C Tutorial 2
PDF
No ratings yet
C Tutorial 2
63 pages
C Programming Language: C Is Case-Sensitive
PDF
No ratings yet
C Programming Language: C Is Case-Sensitive
27 pages
PDS 2
PDF
No ratings yet
PDS 2
34 pages
Lecture 2 DataTypesOperators IP
PDF
No ratings yet
Lecture 2 DataTypesOperators IP
19 pages
Module 3
PDF
No ratings yet
Module 3
24 pages
CP 4
PDF
No ratings yet
CP 4
50 pages
Class3 ProgrammingC Winter24!25!1
PDF
No ratings yet
Class3 ProgrammingC Winter24!25!1
13 pages
Chapter 1 - BASIC OF C - VARIABLE
PDF
No ratings yet
Chapter 1 - BASIC OF C - VARIABLE
31 pages
Week2(1)
PDF
No ratings yet
Week2(1)
39 pages
C Language: Step 1: Creating A Source Code
PDF
No ratings yet
C Language: Step 1: Creating A Source Code
14 pages
CTDS 2
PDF
No ratings yet
CTDS 2
43 pages
Logical Operators
PDF
No ratings yet
Logical Operators
4 pages
CS3353 Unit1
PDF
No ratings yet
CS3353 Unit1
43 pages
Expressions
PDF
No ratings yet
Expressions
25 pages