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)
39 views
C Programming and Data Structures Notes Sample Compressed
Uploaded by
Tanisha 12B2 9
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)
39 views
C Programming and Data Structures Notes Sample Compressed
Uploaded by
Tanisha 12B2 9
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 peocedural fey met iS y uoas nitially evelopect by Dennis Ritchie tw the years at the Bel Telephone Laboratories to develop the UNIX eet system Gs 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 , divers, 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 weather wecasling ete. Clc++ code ts very faster than a code toritten in qava Python. . Z ME C tokens ave the basic balding blocks th ¢ Aang C token ave the smallest — thdividuals unit. © Keytoosds © Tdentigiers ~ © Constants @ Operators @ Special SymbolsCheysord ) ter used in Programming that have special meanings to compiler: (nt money; Herve, int ts keyword and money is vartable- Keywords are P i le These ave keywords tn C Lan; Mr Such as vaviables, functions , structures ete. Tdentifiess must be Unique, as they axe created to give a unique name to an entity to identify Bing the execution program. Whores names must pe ED, vom keywords. @& int money ; Hese money 4 acourtbalance are Wenti- double accountbalance ; Hers. (Constants) WEF A constant is a value that car'ibe changed the prayram. — 10, 20, 4S0 ete. > '@.'b? ete, Octal constant - 021,033, 016 ete opevator ts simply a symbol that is S There can be many types Of operations dike arithmetic gamle Avithmetic Opesators [+,-, ¥, / ] Relational Operators [< <=, > >=, =5, ico ators [ee . il, } Jum In Programming danguage, the special Symbols have some special meantig and they con not be used for other purposes. GP 0,1 tL, ote te] { €xclamation mark — Underscove = Colon % Number sign + plus sign * semicolon ele Pewcent sign > comma Quotation mask Ampersand / slash ? Question mark * Asterisk Equal. to sign * Period.iWarc program basically Consists (Héllostdorla. program Of the following pasts - #f include
© Preprocessox Commands int mainds i ai ® Functions [*Ptyst program */ © variables prinlf(" Hello , Klorld [\n"};~~ ® Statements 4 Expressions return 05 $ ae ® Comments l det us take a Look at the various paris of the above ‘Hello , World!" Program — The first Line of the program Hindude
is a pre-processoy command which tells a ¢ Compiler to (nelude gtdio-h file before going te actual comptlation- The next line int mainc) ts the main function wh- -eve the program execution begins. WG Te next Line /*------ *[ wlll be ignored by the comp- -tler, so such ALfves ase called comments in the program EGF The next Line printfG--) ts another function ushich causes the message “Mello, World!’ to be displayed on scxeen. W& Te next Line veturno; terminates the matn function & returns the value 0. © dato types vefers to On extensive system usec for dedoxive + ov {UMMM = of different types. S Tre type of a variable determines hous much space lt ocu- “pees ln Storage. we Different lata types have different vanges to steve nos. W& Pasically data types ave of cliffesent types — i © Derived Data Type (Pointers . Arrays » structures » Union )Speifiers ed siefined tri: 6 Jorquage. | 4) int Primary data typestn C es =128 to 127 8 | se of MY types + tnt , chav, oa oe ahs : st dlouble- [4 |double 2:3€-308to 16 +309, 1 OF i the int sata type is used to cers integer values. Re ir can be signed ov un signed signed tnt- + thas petal 32 bils (4 bytes). unsigned int- signed. The chas data type ts used to Lnibblee Ubits stese the chavacterc~ W& chasacters must be ingide single quotes: ién usually 4 byle- Range: ree) Whenever we entey a characler type variable, the chara- ~cles is sloved as tnleges value tn the Address Location ¢ float clata type ts used to e oatin point numbers: The numbers that have a fractional past are called oating point numbers- Range: ei has generally 4 bytes + These can vepresent = me dager and wilder vonge of digits as compared! to tn data types UBLE | T =k The double dota type is used to stove floating numbers . Tt occupies twice as much memory as float data type. tt has genesally a bytes % Range: 23 int - 19 20, 30, 100, 1000, 586 ae char - a4 ‘pl, 'L', tw "se Rot a float - 0.7, 0.33 , G21, 6-43, (000.29, 562.0) ete. double — 32.334000 , 14u.469B300 — eteta Ty ce Enumeration Cenum ) ts a user defined data type- CBD \ Cnuvn datatype Tt is mainly used to assign | # include
names to Lntegral constants int maint) £ Value Assignee! must be tn range ehum etter Fab, dP} Of signed tnt. enum deter g: dy Syntaxs) enum enumnamet — 4; | printf ("id 7 y); Pea enum enumname + setund; 3 i Specifies whether to Inlespret the Coxsesponding argument as a Chasacter . a sting, a pointes, an tnteger or 9 number. ee ; : Heled| signed int It ld | tong tnt |b | Potter hu unsigned int — “hd | dong Long tnt +s String bhi shlu | Unsignedl long int “I. X | Hexa decimal hu “Flite nsignes Long Leng int ko eeta. Integer aS A variable (5 @ name given to Storage area that ous programs Can manipulate. RB riasranees UB Too main Concepts of variable; void mainl) @ Declaration int a; © Initialization & Usage Q= 10, Nastable name starts with owes cose ox underscoxe (_)-. B® int abad: + declasing multiple variables tn single line (nt azsi int bz5;—> declaying 2 tnilializing variables. j= A constant” is a value Tat can’t be to to 5, value ts Q=5; FAvaried, solt ts changed tn the program- @ Chov > ‘#',, Qik OES les BS Gypes chor, staing integer| ‘abe’ > X lot a chor eal valued » St SS ai empty can't be @ String> "GATE", Book", thar “India is my County" | % —> X Not valid. must “Newton Desk ” be Im single quotes:ES an opevatos is a symbol that tells the compiler te_perform specifte mathematic TIC OPERA SZLZZIEITIT TTT Seca OE. | 1 + Adlde tion operands. 4 | ___Subtracts second sperand gromfirst:. * _ 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 = scill ement operator clecreases the Cnteges value by one: | Checks if the values of two operands ame equal or not. Cf ves then the Condition becomes trie, lc | Cheeks tt the values of troo operands | 1= | eve equat or net. I} Ale, then the. Condition becomes true- i TH e of wunch és Grea- > er Bran nee of ig oped | The value of let opesand is LS | Us than the value of right operand. “The value of Le$t opesancl Ls greates than or equal to the value of | Me Lrignt operand: | than or equal t the value ot ft le ~ value of dept operand is lese | | right operand: or _dogital functions. int mained § int a=n ,be4; print? ("Sum = eecl\n”, a+b); peintt CL" Diff 2 d\n", a-b); print (" Quotient = “d\n”, ala); pent ( Remainder= 7d \n", arleb) printf Ci asvd\n" ++); yetusn 0; int matnu) § int a=12, b= 4; iy dSgreatnttanns/-o \n's Qk); printé (tieel is equal te-Ad \n"a,b); i#laj=b) printé Ud ts not equat to ed \n? a,b); welurn o; la>b printf tla.Ops. Descesfption Logical: Anns Lf both the 4d | operands are non Zero then | Condttions becomes true. i | Loptead ot > any of 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 circuit incase of £2 > NU there ts a condition |@rywohere tr e& pression that — return false then yest of the Cond” after that will not evaluatec| er fn expression that yetusy fue then rest ofthe condition, 46 operand. after that will not be evaluates aaa, ~ ~ a . = BITWISE OPERATORS I) Lee (aor Tasce z Samay eae ene PAG Ops 5 oa Raa ate al o o ° g Btnacy AND-> Tt copies a bt f 8 7 to the result Y Ut exib fn 0-| ° J dt cMeslloaa a | \ Binasy OR» Lt coples a Bt YY ; \ || exists tn efther operands. | i. 2 1). | Binaxy xoR—> Tt copies the bit Une) : | oTn bitise Left/Right shyp shell ceae ie AE. sper the trailing andl tebatng eS Binary One's complement» Tt hag Pos? are ‘Hued tot, 20x06, the ctect of Sipping bits. ie “|Binasy Left shift > The value. ts es movecl Lett by the. numberof Descziption 4 peal bicsd pitas pemavid 3] Right shifting is equ iy | Bling Aigne pee te asge Tae ae >»> operablal ga eukS area aight by ee dvlon 4 ae ie the no of bits specified. BAG Opes Assignment op’ > Assigns valu — p? right Bie Ss sai xia’ to left operand. Bend [Subtract ahet asci pent opt» | and assignment -= (Lt cubstracte Se vigt oper rip ga jand. assign t kept operands |, operand & assign to lefet_ Divide ancl Assignment opfs|| Modulus and Assignment opt '= Tt olivicles the Gee operand) ¥j,-| Tt takes modulus using too with the right operand 4 operands £ assigns the result pessigns: ope pat Lge ara Left shift and assignment op >>= Right shift ancl assignment opt: | Bitwise and assignment: opr. n= | Bitwise ex-oR & assignment opr: Bitwoise oR L ascignment opt " ) Returns the of variabl Returns the address of vasiable- | Pointer to a varfable- Sizeof OPERATOR [see OF ae PWG sock, operator com- ~putes the size of variable Coyte)- aS x ts a unasy operator. For float values use dike this Le io2F otheswise ft wtll be treatec! as doubleCio2) oF use typecasting for float and cloubk- BES for chasactes data type ie char values” use typecacting or dfrectly use datatype ox variable- Operands can be variable , constant data pe: size of (x); , sizeof lint); , sizeof ts); (vee casteng Jy /ge Tt refers to changing an variable of one dala type tnto another. BS me compiles uatll automatlealty change one type of data nto another [tf [tt make sense. af Types “EMPureeT TYPE reXPLECET ~ TYPE” @hWhen the type conversion is perfor-[ ® The type conversion performed -med automal ically by the compiler by the programmes by posing the wofthout programmer's intervention cata. type of expression of speefHe Sud) type of Lonversion is kneon type ts known as explicit type as implicit type eonversion or type 7 _eonversion- romotion.s tnt x; for (X=491; x<=122; x44) intx; get For (1291; xee 125 X44) ies re Svinte Une", (hav) x); we \ t tostnte 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
C Notes
PDF
No ratings yet
C Notes
241 pages
C Programming Notes Part 1
PDF
No ratings yet
C Programming Notes Part 1
24 pages
Programming Keys
PDF
No ratings yet
Programming Keys
20 pages
module 1-2
PDF
No ratings yet
module 1-2
32 pages
3. DSA
PDF
No ratings yet
3. DSA
70 pages
Types, Operators, and Express Ions
PDF
No ratings yet
Types, Operators, and Express Ions
50 pages
Components of C Program
PDF
No ratings yet
Components of C Program
64 pages
UNIT-1_PSTC
PDF
No ratings yet
UNIT-1_PSTC
25 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
2 C Prog 02
PDF
No ratings yet
2 C Prog 02
28 pages
Computer Program
PDF
No ratings yet
Computer Program
23 pages
C Tutorial
PDF
No ratings yet
C Tutorial
63 pages
lecture 4
PDF
No ratings yet
lecture 4
24 pages
Internship Report C and C++
PDF
No ratings yet
Internship Report C and C++
31 pages
Fall 23-24-Lecture 2 DataTypesOperators
PDF
No ratings yet
Fall 23-24-Lecture 2 DataTypesOperators
22 pages
Data Types Expressions C
PDF
No ratings yet
Data Types Expressions C
34 pages
Pic 1 To 3 Chaptersslide Shows 1-59
PDF
100% (1)
Pic 1 To 3 Chaptersslide Shows 1-59
59 pages
C Tutorial 2
PDF
No ratings yet
C Tutorial 2
63 pages
PDS 2
PDF
No ratings yet
PDS 2
34 pages
02 Javam
PDF
No ratings yet
02 Javam
42 pages
Getting Started in C
PDF
No ratings yet
Getting Started in C
29 pages
New ?
PDF
No ratings yet
New ?
25 pages
CPP Notes Upto Recursion
PDF
No ratings yet
CPP Notes Upto Recursion
24 pages
Programming and Data Structures (PDS) : CS11001/CS11002
PDF
No ratings yet
Programming and Data Structures (PDS) : CS11001/CS11002
12 pages
C Programming Complete Notes
PDF
100% (6)
C Programming Complete Notes
147 pages
Week2(1)
PDF
No ratings yet
Week2(1)
39 pages
Module 3 - Intro To C++
PDF
No ratings yet
Module 3 - Intro To C++
54 pages
Variables and Data Types - C
PDF
No ratings yet
Variables and Data Types - C
6 pages
C & DS Unit - I
PDF
No ratings yet
C & DS Unit - I
58 pages
Unit-1.2.pptx Removed
PDF
No ratings yet
Unit-1.2.pptx Removed
76 pages
Data Classification (Data Types)
PDF
No ratings yet
Data Classification (Data Types)
34 pages
Expressions
PDF
No ratings yet
Expressions
25 pages
C Fundamentals
PDF
No ratings yet
C Fundamentals
31 pages
Lecture2 DataTypesOperators
PDF
No ratings yet
Lecture2 DataTypesOperators
16 pages
Programming For Problem Solving Using C and C RBU
PDF
No ratings yet
Programming For Problem Solving Using C and C RBU
69 pages
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
PDF
No ratings yet
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
59 pages
Assignment 1 .pdf
PDF
No ratings yet
Assignment 1 .pdf
9 pages
selfstudy(c programming)
PDF
No ratings yet
selfstudy(c programming)
11 pages
01b Data Types Expressions RSC
PDF
No ratings yet
01b Data Types Expressions RSC
34 pages
Class 2
PDF
No ratings yet
Class 2
90 pages
Dex University C Programing Lecture Note
PDF
No ratings yet
Dex University C Programing Lecture Note
170 pages
Logical Operators
PDF
No ratings yet
Logical Operators
4 pages
C Programming Language: C Is Case-Sensitive
PDF
No ratings yet
C Programming Language: C Is Case-Sensitive
27 pages
Oops
PDF
No ratings yet
Oops
52 pages
PPS ch2
PDF
No ratings yet
PPS ch2
34 pages
CP 4
PDF
No ratings yet
CP 4
50 pages
What Is C?: Rules To Name A Variable
PDF
No ratings yet
What Is C?: Rules To Name A Variable
7 pages
3 Data Structures - 8096095
PDF
No ratings yet
3 Data Structures - 8096095
46 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
Class3 ProgrammingC Winter24!25!1
PDF
No ratings yet
Class3 ProgrammingC Winter24!25!1
13 pages
C Programming
PDF
No ratings yet
C Programming
42 pages
IP Lecture 2 DataTypesOperators
PDF
No ratings yet
IP Lecture 2 DataTypesOperators
19 pages
L2-Constants, Data Types and Operators
PDF
No ratings yet
L2-Constants, Data Types and Operators
53 pages
PSUC UNIT II
PDF
No ratings yet
PSUC UNIT II
143 pages
Cheat Sheet
PDF
No ratings yet
Cheat Sheet
6 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
C Notes
PDF
C Notes
C Programming Notes Part 1
PDF
C Programming Notes Part 1
Programming Keys
PDF
Programming Keys
module 1-2
PDF
module 1-2
3. DSA
PDF
3. DSA
Types, Operators, and Express Ions
PDF
Types, Operators, and Express Ions
Components of C Program
PDF
Components of C Program
UNIT-1_PSTC
PDF
UNIT-1_PSTC
C4 OperatorExp 2012 Eng PDF
PDF
C4 OperatorExp 2012 Eng PDF
C4 Vfsrfa2012 Eng
PDF
C4 Vfsrfa2012 Eng
2 C Prog 02
PDF
2 C Prog 02
Computer Program
PDF
Computer Program
C Tutorial
PDF
C Tutorial
lecture 4
PDF
lecture 4
Internship Report C and C++
PDF
Internship Report C and C++
Fall 23-24-Lecture 2 DataTypesOperators
PDF
Fall 23-24-Lecture 2 DataTypesOperators
Data Types Expressions C
PDF
Data Types Expressions C
Pic 1 To 3 Chaptersslide Shows 1-59
PDF
Pic 1 To 3 Chaptersslide Shows 1-59
C Tutorial 2
PDF
C Tutorial 2
PDS 2
PDF
PDS 2
02 Javam
PDF
02 Javam
Getting Started in C
PDF
Getting Started in C
New ?
PDF
New ?
CPP Notes Upto Recursion
PDF
CPP Notes Upto Recursion
Programming and Data Structures (PDS) : CS11001/CS11002
PDF
Programming and Data Structures (PDS) : CS11001/CS11002
C Programming Complete Notes
PDF
C Programming Complete Notes
Week2(1)
PDF
Week2(1)
Module 3 - Intro To C++
PDF
Module 3 - Intro To C++
Variables and Data Types - C
PDF
Variables and Data Types - C
C & DS Unit - I
PDF
C & DS Unit - I
Unit-1.2.pptx Removed
PDF
Unit-1.2.pptx Removed
Data Classification (Data Types)
PDF
Data Classification (Data Types)
Expressions
PDF
Expressions
C Fundamentals
PDF
C Fundamentals
Lecture2 DataTypesOperators
PDF
Lecture2 DataTypesOperators
Programming For Problem Solving Using C and C RBU
PDF
Programming For Problem Solving Using C and C RBU
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
PDF
Getting Input From Input Dialog Boxes: - Byte, Short, Int, Long, Float, Double, Char, Boolean
Assignment 1 .pdf
PDF
Assignment 1 .pdf
selfstudy(c programming)
PDF
selfstudy(c programming)
01b Data Types Expressions RSC
PDF
01b Data Types Expressions RSC
Class 2
PDF
Class 2
Dex University C Programing Lecture Note
PDF
Dex University C Programing Lecture Note
Logical Operators
PDF
Logical Operators
C Programming Language: C Is Case-Sensitive
PDF
C Programming Language: C Is Case-Sensitive
Oops
PDF
Oops
PPS ch2
PDF
PPS ch2
CP 4
PDF
CP 4
What Is C?: Rules To Name A Variable
PDF
What Is C?: Rules To Name A Variable
3 Data Structures - 8096095
PDF
3 Data Structures - 8096095
Data Types & Basic Constructs (If, If-Else, Switch-Case)
PDF
Data Types & Basic Constructs (If, If-Else, Switch-Case)
Class3 ProgrammingC Winter24!25!1
PDF
Class3 ProgrammingC Winter24!25!1
C Programming
PDF
C Programming
IP Lecture 2 DataTypesOperators
PDF
IP Lecture 2 DataTypesOperators
L2-Constants, Data Types and Operators
PDF
L2-Constants, Data Types and Operators
PSUC UNIT II
PDF
PSUC UNIT II
Cheat Sheet
PDF
Cheat Sheet