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)
25 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)
25 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
C Programming and Data Structures Notes Sample Compressed
PDF
No ratings yet
C Programming and Data Structures Notes Sample Compressed
8 pages
C Programming & Data Structure Sample
PDF
No ratings yet
C Programming & Data Structure Sample
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 Vfsrfa2012 Eng
PDF
No ratings yet
C4 Vfsrfa2012 Eng
30 pages
C4 OperatorExp 2012 Eng PDF
PDF
No ratings yet
C4 OperatorExp 2012 Eng PDF
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
01b Data Types Expressions RSC
PDF
No ratings yet
01b Data Types Expressions RSC
34 pages
Pic 1 To 3 Chaptersslide Shows 1-59
PDF
100% (1)
Pic 1 To 3 Chaptersslide Shows 1-59
59 pages
IP Lecture 2 DataTypesOperators
PDF
No ratings yet
IP Lecture 2 DataTypesOperators
19 pages
PPS ch2
PDF
No ratings yet
PPS ch2
34 pages
C Unit-1 PPT
PDF
No ratings yet
C Unit-1 PPT
47 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
C Fundamentals
PDF
No ratings yet
C Fundamentals
31 pages
What Is C?: Rules To Name A Variable
PDF
No ratings yet
What Is C?: Rules To Name A Variable
7 pages
selfstudy(c programming)
PDF
No ratings yet
selfstudy(c programming)
11 pages
1_Variable,Datatype&Operator
PDF
No ratings yet
1_Variable,Datatype&Operator
33 pages
Programming and Data Structures (PDS) : CS11001/CS11002
PDF
No ratings yet
Programming and Data Structures (PDS) : CS11001/CS11002
12 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
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
C Programming and Data Structures Notes Sample Compressed
PDF
C Programming and Data Structures Notes Sample Compressed
C Programming & Data Structure Sample
PDF
C Programming & Data Structure Sample
module 1-2
PDF
module 1-2
Programming Keys
PDF
Programming Keys
C Programming Notes Part 1
PDF
C Programming Notes Part 1
C Notes
PDF
C Notes
C & DS Unit - I
PDF
C & DS Unit - I
3. DSA
PDF
3. DSA
Computer Program
PDF
Computer Program
lecture 4
PDF
lecture 4
Components of C Program
PDF
Components of C Program
Types, Operators, and Express Ions
PDF
Types, Operators, and Express Ions
CPP Notes Upto Recursion
PDF
CPP Notes Upto Recursion
Getting Started in C
PDF
Getting Started in C
Internship Report C and C++
PDF
Internship Report C and C++
C4 Vfsrfa2012 Eng
PDF
C4 Vfsrfa2012 Eng
C4 OperatorExp 2012 Eng PDF
PDF
C4 OperatorExp 2012 Eng PDF
Fall 23-24-Lecture 2 DataTypesOperators
PDF
Fall 23-24-Lecture 2 DataTypesOperators
Data Classification (Data Types)
PDF
Data Classification (Data Types)
2 C Prog 02
PDF
2 C Prog 02
UNIT-1_PSTC
PDF
UNIT-1_PSTC
Data Types Expressions C
PDF
Data Types Expressions C
C Tutorial
PDF
C Tutorial
PSUC UNIT II
PDF
PSUC UNIT II
Data Types & Basic Constructs (If, If-Else, Switch-Case)
PDF
Data Types & Basic Constructs (If, If-Else, Switch-Case)
Oops
PDF
Oops
BCSE102L Structured and Object Oriented: Programming
PDF
BCSE102L Structured and Object Oriented: Programming
Dex University C Programing Lecture Note
PDF
Dex University C Programing Lecture Note
01b Data Types Expressions RSC
PDF
01b Data Types Expressions RSC
Pic 1 To 3 Chaptersslide Shows 1-59
PDF
Pic 1 To 3 Chaptersslide Shows 1-59
IP Lecture 2 DataTypesOperators
PDF
IP Lecture 2 DataTypesOperators
PPS ch2
PDF
PPS ch2
C Unit-1 PPT
PDF
C Unit-1 PPT
Lecture2 DataTypesOperators
PDF
Lecture2 DataTypesOperators
Variables and Data Types - C
PDF
Variables and Data Types - C
C Programming Complete Notes
PDF
C Programming Complete Notes
Topic 2 - Introduction To C
PDF
Topic 2 - Introduction To C
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
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
C Fundamentals
PDF
C Fundamentals
What Is C?: Rules To Name A Variable
PDF
What Is C?: Rules To Name A Variable
selfstudy(c programming)
PDF
selfstudy(c programming)
1_Variable,Datatype&Operator
PDF
1_Variable,Datatype&Operator
Programming and Data Structures (PDS) : CS11001/CS11002
PDF
Programming and Data Structures (PDS) : CS11001/CS11002
L2-Constants, Data Types and Operators
PDF
L2-Constants, Data Types and Operators
1 Variable, Datatype&Operator
PDF
1 Variable, Datatype&Operator
C Tutorial 2
PDF
C Tutorial 2
C Programming Language: C Is Case-Sensitive
PDF
C Programming Language: C Is Case-Sensitive
PDS 2
PDF
PDS 2
Lecture 2 DataTypesOperators IP
PDF
Lecture 2 DataTypesOperators IP
Module 3
PDF
Module 3
CP 4
PDF
CP 4
Class3 ProgrammingC Winter24!25!1
PDF
Class3 ProgrammingC Winter24!25!1
Chapter 1 - BASIC OF C - VARIABLE
PDF
Chapter 1 - BASIC OF C - VARIABLE
Week2(1)
PDF
Week2(1)
C Language: Step 1: Creating A Source Code
PDF
C Language: Step 1: Creating A Source Code
CTDS 2
PDF
CTDS 2
Logical Operators
PDF
Logical Operators
CS3353 Unit1
PDF
CS3353 Unit1