SlideShare ist ein Scribd-Unternehmen logo
1 von 27
By,
Rama Boya
 C Tokens
 Identifiers
 Keywords
 Constants
 Operators
 Data types
 Variables
 Type casting
C Supports Six Types of Tokens:
 Identifiers
 Keywords
 Constants
 Strings
 Operators
 Special Symbols
 Identifiers are names given to different entitie such as
constants, variables, structures, functions, etc.
Example :
int amount;
double totalbalance;
 An identifier can only have alphanumeric characters (a-z , A-Z
, 0-9) (i.e. letters & digits) and underscore( _ ) symbol.
 Identifier names must be unique
 The first character must be an alphabet or underscore.
 You cannot use a keyword as identifiers.
 Only the first thirty-one (31) characters are significant.
 It must not contain white spaces.
 Identifiers are case-sensitive.
 The C Keywords must be in your information because you can
not use them as a variable name.
 You can't use a keyword as an identifier in your C programs, its
reserved words in C library and used to perform an internal
operation.
 The meaning and working of these keywords are already
known to the compiler.
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
 Constants are like a variable, except that their value never
changes during execution once defined.
 Constants are also called literals.
 Constants can be any of the data types.
 It is considered best practice to define constants using
only upper-case names.
Syntax :
const type constant_name;
 Constants are categorized into two basic types, and each of
these types has its subtypes/categories. These are:
 Primary Constants
 Numeric Constants
 Character Constants
 Secondary Constants
 Array
 Pointer
 Structure
 Union
 Enum
Integer Constant :
Integers are of three types
 Decimal Integer
 Octal Integer
 Hexadecimal Integer
Example:
15, -265, 0, 99818, +25, 045, 0X6
Real Constant :
 The numbers containing fractional parts like 99.25 are called
real or floating points constant.
 Single Character Constants
 It simply contains a single character enclosed within ' and '
(a pair of single quote).
 String Constants
 These are a sequence of characters enclosed in double quotes, and they
may include letters, digits, special characters, and blank spaces.
 Backslash Character Constants
 C supports some character constants having a backslash in front of it.
Constants Meaning
a beep sound
b backspace
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
' single quote
" double quote
 backslash
0 null
 C operators are symbols that are used to perform mathematical
or logical manipulations.
 Operators take part in a program for manipulating data and
variables and form a part of the mathematical or logical
expressions.
 C programming language offers various types of operators
having different functioning capabilities.
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Assignment Operators
5. Increment and Decrement Operators
6. Conditional Operator
7. Bitwise Operators
8. Special Operators
Arithmetic Operators are used to performing mathematical calculations
Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
Relational operators are used to comparing two quantities or values.
Operator Description
== Is equal to
!= Is not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
C provides three logical operators when we test more than one condition to
make decisions.
Operator Description
&& And operator. It performs logical conjunction of two
expressions. (if both expressions evaluate to True, result
is True. If either expression evaluates to False, the result
is False)
|| Or operator. It performs a logical disjunction on two
expressions. (if either or both expressions evaluate to
True, the result is True)
! Not operator. It performs logical negation on an
expression.
Operator Description
= Assign
+= Increments then assign
-= Decrements then assign
*= Multiplies then assign
/= Divides then assign
%= Modulus then assign
<<= Left shift and assign
>>= Right shift and assign
&= Bitwise AND assign
^= Bitwise exclusive OR and assign
|= Bitwise inclusive OR and assign
 Increment and Decrement Operators are useful operators generally used to
minimize the calculation, i.e. ++x and x++ means x=x+1 or -x and
x−−means x=x-1.
Operator Description
++ Increment
−− Decrement
 C offers a ternary operator which is the conditional operator to construct
conditional expressions.
Operator Description
? : Conditional Expression
C provides a special operator for bit operation between two variables.
Operator Description
<< Binary Left Shift Operator
>> Binary Right Shift Operator
~ Binary Ones Complement Operator
& Binary AND Operator
^ Binary XOR Operator
| Binary OR Operator
Operator Description
sizeof() Returns the size of a memory location.
& Returns the address of a memory location.
* Pointer to a variable.
 A data-type in C programming is a set of values and is
determined to act on those values.
C Data Types are used to:
 Identify the type of a variable when it declared.
 Identify the type of the return value of a function.
 Identify the type of a parameter expected by a function.
 Three Types of Data Types:
1. Primary(Built-in) Data Types:
void, int, char, double and float.
2. Derived Data Types:
Array, References, and Pointers.
3. User Defined Data Types:
Structure, Union, and Enumeration.
 Variables are memory locations(storage area) in the C
programming language.
Syntax:
type variable_name;
(or)
type variable_name, variable_name, variable_name;
 A variable name can consist of Capital letters A-Z, lowercase
letters a-z, digits 0-9, and the underscore character.
 The first character must be a letter or underscore.
 Blank spaces cannot be used in variable names.
 Special characters like #, $ are not allowed.
 C keywords cannot be used as variable names.
 Variable names are case sensitive.
 Values of the variables can be numeric or alphabetic.
 Variable type can be char, int, float, double, or void.
 Type Casting in C is used to convert a variable from one data
type to another data type, and after type casting compiler treats
the variable as of the new data type.
Syntax:
(type_name) expression
Fundamentals of C Programming Language

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorial
 
Type casting
Type castingType casting
Type casting
 
07 java variables
07   java variables07   java variables
07 java variables
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C Programming
 
Operator overloading C++
Operator overloading C++Operator overloading C++
Operator overloading C++
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Union in C programming
Union in C programmingUnion in C programming
Union in C programming
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
C tokens
C tokensC tokens
C tokens
 
structure and union
structure and unionstructure and union
structure and union
 
C functions
C functionsC functions
C functions
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
Pointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cppPointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cpp
 
Typecasting in c
Typecasting in cTypecasting in c
Typecasting in c
 
Array
ArrayArray
Array
 
Strings
StringsStrings
Strings
 
Array in C
Array in CArray in C
Array in C
 

Ähnlich wie Fundamentals of C Programming Language

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introductionnikshaikh786
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
C language (more)
C language (more)C language (more)
C language (more)marar hina
 
Introduction to C Programming - R.D.Sivakumar
Introduction to C Programming -  R.D.SivakumarIntroduction to C Programming -  R.D.Sivakumar
Introduction to C Programming - R.D.SivakumarSivakumar R D .
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++Aahwini Esware gowda
 
Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++Rokonuzzaman Rony
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsLearn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsEng Teong Cheah
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiSowmyaJyothi3
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++K Durga Prasad
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageRai University
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageRai University
 

Ähnlich wie Fundamentals of C Programming Language (20)

C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
C Token’s
C Token’sC Token’s
C Token’s
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
 
C language (more)
C language (more)C language (more)
C language (more)
 
Introduction to C Programming - R.D.Sivakumar
Introduction to C Programming -  R.D.SivakumarIntroduction to C Programming -  R.D.Sivakumar
Introduction to C Programming - R.D.Sivakumar
 
C Slides
C SlidesC Slides
C Slides
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Learn C# Programming - Variables & Constants
Learn C# Programming - Variables & ConstantsLearn C# Programming - Variables & Constants
Learn C# Programming - Variables & Constants
 
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya JyothiConstants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
 
Getting started with C++
Getting started with C++Getting started with C++
Getting started with C++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Introduction
IntroductionIntroduction
Introduction
 
Basics of c
Basics of cBasics of c
Basics of c
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
 

Kürzlich hochgeladen

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 

Kürzlich hochgeladen (20)

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 

Fundamentals of C Programming Language

  • 2.  C Tokens  Identifiers  Keywords  Constants  Operators  Data types  Variables  Type casting
  • 3. C Supports Six Types of Tokens:  Identifiers  Keywords  Constants  Strings  Operators  Special Symbols
  • 4.  Identifiers are names given to different entitie such as constants, variables, structures, functions, etc. Example : int amount; double totalbalance;
  • 5.  An identifier can only have alphanumeric characters (a-z , A-Z , 0-9) (i.e. letters & digits) and underscore( _ ) symbol.  Identifier names must be unique  The first character must be an alphabet or underscore.  You cannot use a keyword as identifiers.  Only the first thirty-one (31) characters are significant.  It must not contain white spaces.  Identifiers are case-sensitive.
  • 6.  The C Keywords must be in your information because you can not use them as a variable name.  You can't use a keyword as an identifier in your C programs, its reserved words in C library and used to perform an internal operation.  The meaning and working of these keywords are already known to the compiler.
  • 7. auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 8.  Constants are like a variable, except that their value never changes during execution once defined.  Constants are also called literals.  Constants can be any of the data types.  It is considered best practice to define constants using only upper-case names. Syntax : const type constant_name;
  • 9.  Constants are categorized into two basic types, and each of these types has its subtypes/categories. These are:  Primary Constants  Numeric Constants  Character Constants  Secondary Constants  Array  Pointer  Structure  Union  Enum
  • 10. Integer Constant : Integers are of three types  Decimal Integer  Octal Integer  Hexadecimal Integer Example: 15, -265, 0, 99818, +25, 045, 0X6 Real Constant :  The numbers containing fractional parts like 99.25 are called real or floating points constant.
  • 11.  Single Character Constants  It simply contains a single character enclosed within ' and ' (a pair of single quote).  String Constants  These are a sequence of characters enclosed in double quotes, and they may include letters, digits, special characters, and blank spaces.  Backslash Character Constants  C supports some character constants having a backslash in front of it.
  • 12. Constants Meaning a beep sound b backspace f form feed n new line r carriage return t horizontal tab v vertical tab ' single quote " double quote backslash 0 null
  • 13.  C operators are symbols that are used to perform mathematical or logical manipulations.  Operators take part in a program for manipulating data and variables and form a part of the mathematical or logical expressions.
  • 14.  C programming language offers various types of operators having different functioning capabilities. 1. Arithmetic Operators 2. Relational Operators 3. Logical Operators 4. Assignment Operators 5. Increment and Decrement Operators 6. Conditional Operator 7. Bitwise Operators 8. Special Operators
  • 15. Arithmetic Operators are used to performing mathematical calculations Operator Description + Addition - Subtraction * Multiplication / Division % Modulus
  • 16. Relational operators are used to comparing two quantities or values. Operator Description == Is equal to != Is not equal to > Greater than < Less than >= Greater than or equal to <= Less than or equal to
  • 17. C provides three logical operators when we test more than one condition to make decisions. Operator Description && And operator. It performs logical conjunction of two expressions. (if both expressions evaluate to True, result is True. If either expression evaluates to False, the result is False) || Or operator. It performs a logical disjunction on two expressions. (if either or both expressions evaluate to True, the result is True) ! Not operator. It performs logical negation on an expression.
  • 18. Operator Description = Assign += Increments then assign -= Decrements then assign *= Multiplies then assign /= Divides then assign %= Modulus then assign <<= Left shift and assign >>= Right shift and assign &= Bitwise AND assign ^= Bitwise exclusive OR and assign |= Bitwise inclusive OR and assign
  • 19.  Increment and Decrement Operators are useful operators generally used to minimize the calculation, i.e. ++x and x++ means x=x+1 or -x and x−−means x=x-1. Operator Description ++ Increment −− Decrement
  • 20.  C offers a ternary operator which is the conditional operator to construct conditional expressions. Operator Description ? : Conditional Expression
  • 21. C provides a special operator for bit operation between two variables. Operator Description << Binary Left Shift Operator >> Binary Right Shift Operator ~ Binary Ones Complement Operator & Binary AND Operator ^ Binary XOR Operator | Binary OR Operator
  • 22. Operator Description sizeof() Returns the size of a memory location. & Returns the address of a memory location. * Pointer to a variable.
  • 23.  A data-type in C programming is a set of values and is determined to act on those values. C Data Types are used to:  Identify the type of a variable when it declared.  Identify the type of the return value of a function.  Identify the type of a parameter expected by a function.  Three Types of Data Types: 1. Primary(Built-in) Data Types: void, int, char, double and float. 2. Derived Data Types: Array, References, and Pointers. 3. User Defined Data Types: Structure, Union, and Enumeration.
  • 24.  Variables are memory locations(storage area) in the C programming language. Syntax: type variable_name; (or) type variable_name, variable_name, variable_name;
  • 25.  A variable name can consist of Capital letters A-Z, lowercase letters a-z, digits 0-9, and the underscore character.  The first character must be a letter or underscore.  Blank spaces cannot be used in variable names.  Special characters like #, $ are not allowed.  C keywords cannot be used as variable names.  Variable names are case sensitive.  Values of the variables can be numeric or alphabetic.  Variable type can be char, int, float, double, or void.
  • 26.  Type Casting in C is used to convert a variable from one data type to another data type, and after type casting compiler treats the variable as of the new data type. Syntax: (type_name) expression