SlideShare a Scribd company logo
CONSTANTS, VARIABLES &
DATATYPES
BY
SAHITHI NARAPARAJU
INRODUCTION
• A programming language is designed to help process certain
kinds of data consisting of numbers, characters and strings to
provide useful output known as information.
• The task of processing of data is accomplished by executing a
sequence of precise instructions called program.
• These instructions are formed using certain symbols and
words according to some rigid rules known as syntax rules.
CHARACTER SET:
• The characters in C are grouped into following categories:
1) Letters 2) digits
3) special characters 4) white spaces.
• Compiler ignores white spaces unless they are part of a string
constant.
• White spaces may be used to separate words but prohibited
between characters of keywords and identifiers.
• LETTERS: Uppercase A….Z, lower case a..z.
• DIGITS: All decimal digits 0..9
• SPECIAL CHARACTERS: comma(,), period(.),
semicolon(;) , colon(:), question mark(?), quotation(“), dollar
sign($), slash(/),back slash(), percent sign(%), underscore(_),
ampersand(&), asterisk(*), number sign(#).
• WHITE SPACES: Blank space, Horizontal tab, Carriage
return, Newline, Form feed.
Trigraph characters:
• C introduces the concept of trigraph sequences to provide a
way to enter certain characters that are not available on some
keywords.
• Each trigraph sequence consists of three characters, 2 question
marks followed by another character.
• Eg: ??= (number sign), ??)(right bracket]), ??( (left
bracket[) , ??! (vertical bar), ??< (left brace {) , ??> (right brace
}),??/ (back slash).
C tokens:
•

In a passage of text individual words and punctuation marks
are called tokens.

•

In a C program the smallest individual units known as C
tokens.

•
C has 6 types of tokens namely:
1) Keywords
2) identifiers
3)constants
4)Strings
5)special symbols
6)operators.
Keywords and identifiers.
• Every C word is classified as either a keyword or an identifier.
• All keywords have fixed meanings and these meanings cannot
be changed.
• Keywords serve as basic building blocks for program
statements.
• All keywords must be written in lower case.
• The underscore character is also permitted in identifiers.
• It is usually used a link between two words in long identifiers
RULES FOR IDENTIFIERS:
1.
2.
3.
4.
5.

First character must be an alphabet.
Must consist of only letters, digits or underscore.
Only first 31 characters are significant.
Cannot use keyword.
Must not contain white space.
CONSTANTS
• Constants refer to fixed values that do not change during the
execution of program.

INTEGER CONSTANTS:
• An integer constant refer to a sequence of digits.
• There are 3 types of integers namely:
Decimal integer, octal integer and hexadecimal integer.
• Decimal integer consist of a set of digits 0 through
9,precceded by an optional – or + sign.
• An octal integer constant consist of any combination of digits
from the set 0 through 7. with a leading 0
• Eg: 037,0, 0456.
• A sequence of digits preceded by 0x or 0X is considered as
hexadecimal integer.
• They may include alphabets A through F or f.
• Letter A through F represents numbesr 10 to 15.
REAL CONSTANTS:
• To represent quantities that vary continuously real constants
are used.
• A real number may be expressed in exponential notation.
SYNTAX: mantissa e exponent.
• Mantissa can be either real number expressed in decimal
notation or an integer.
• Exponent is an integer number with an optional + or – sign.
• The letter ‘e’ separating the mantissa and the exponent, it can
be written either lower case or upper case.
SYNTAX: 0.65e4,12e-2.
• White space is not allowed.
• Exponential notation is useful for representing numbers that
are either very large or very small in magnitude.
• Floating point constants are normally represented as doubleprecision quantities.

SINGLE CHARACTER CONSTANTS:
• A single character constant contains a single character enclose
in a pair of single quote marks.
Eg: ‘5’,’x’.
• Character constant ‘5’ is not same as number 5.
• Character constants have integer values known as ASCII
values.
• Statement: printf (“%d”, ’a’); would print number 97, the
ASCII value of letter ‘a’.
• Since each character constant represent an integer value, it is
possible to perform arithmetic operations on character
constants.
STRING CONSTANTS:
• A string constant is a sequence of characters enclosed in
double quotes.
• Characters may be letters, numbers, special characters and
blank spaces.
Eg: “hello” , “1987”, “?...!”.
• Character constant is not equivalent to single character string
constant.

.
BACK SLASH CHARACTER CONSTANTS:
• C supports some special back slash character constants that
are used in output functions.
• These characters combinations are known as escape
sequences.
• Back slash character constants are:
‘a’ audible alert; ‘b’ backspace; ‘f’ form feed; ‘n’ newline;
‘r’ carriage return; ‘t’ horizontal tab; ‘v’ vertical tab;
‘”single quote, ‘?’ question mark; ‘’ backslash; ‘0’ null.
VARIABLES
•

A variable is a data name that may be used to store a data
value.

•

A variable may take different values at different times
during execution.

•

A variable can be chosen by the programmer in a
meaningful way.

CONDITIONS FOR SPECIFYING VARIABLES:
1.

They must begin with a letter. Some systems may permit
underscore as first character.
1.

Uppercase and lowercase are significant. The variable
TOTAL is different from total and Total.

2.

It should not be keyword.

3.

Whitespace is not allowed.

4.

Length should be normally more than 8 characters are
treated as significant by many compilers.

•

Examples of valid variables are:
john, x1,T_raise, first_tag.

•

Examples of invalid variables are:
123,(area),25th,price$, %.
DATATYPES
• C language is rich in its data types.
• Storage representations and machine instructions to handle
constants differ from machine to machine.
• The variety of datatypes allow to select the type appropriate to
the needs of the application as well as machine.
• C supports 3 classes of datatypes:
1)Primary datatypes
2) derived datatypes
3)derived datatypes.
• All C compilers support 5 fundamental datatypes namely:
integer (int), character (char), floating point (float), doubleprecision floating point (double) and void.
• Many of them also offer extended datatypes such as long int,
int ,long double.
Data type
Range of values
char
-128 to 127
int
-32768 to 32767
float
-3.4e+8 to 3.4e+8
double
1.7e-308 to 1.7e+308.
INTEGER TYPES:
• Integers are whole numbers with a range of values supported
by particular machine.
• Integers occupy one word storage generally and since the
word sizes of machine vary the size of integer that can be
stored depends on computer.
• If we use 16-bit word length, the size of integer value is
limited to range -32768 to 32767.
• If we use 32-bit word length can store an integer ranging from
-2147483648 to 2147483647.
• In order to provide control over range of numbers and storage
space C has 3 classes of integer storage namely: short int, int,
long int in both signed and unsigned.
• Short int represents fairly small integer values and requires
half amount as regular int number uses.

FLOATING POINT TYPE:
•

Floating point numbers are stored in 32bits, with 6 digit
precision.

• Floating point numbers are defined by keyword “float”.
• When accuracy is provided by a float number is not sufficient,
double can be used to define number.
• A double datatype number uses 64 bits giving a precision of
14 digits.
• These are known as double precision number.
• Double datatype represent the same datatype that float
represents but with greater precision.
• To extend the precision we may use long double which uses
80 bits.
VOID TYPES:
• Void type has no values. This is used to specify the type of
functions.
• The type of function is said to be void when it doesn't return
any value to the calling function.

CHARACTER TYPES:
• A single character can be defined as a character (char) type
data.
• Characters are usually store in one byte of internal storage.
• Qualifier signed or unsigned may be used in char explicitly.
Unsigned characters have values between 0 and 255, signed
characters have values from -128 to 127

More Related Content

What's hot

Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
Qazi Shahzad Ali
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
eShikshak
 
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
Kamal Acharya
 
C Tutorial
C TutorialC Tutorial
C Tutorial
Dr.Subha Krishna
 
C data type format specifier
C data type format specifierC data type format specifier
C data type format specifier
Sandip Sitäulä
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
Ameer Khan
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 
Data type
Data typeData type
Data type
Isha Aggarwal
 
Character set of c
Character set of cCharacter set of c
Character set of c
Chandrapriya Rediex
 
Data Types in C
Data Types in CData Types in C
Data Types in C
yarkhosh
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Tanveer Malik
 
Data types in c language
Data types in c languageData types in c language
Data types in c language
HarihamShiwani
 
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
MOHIT TOMAR
 
Data type
Data typeData type
Data type
Frijo Francis
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
Mahender Boda
 
Complete Tokens in c/c++
Complete Tokens in c/c++Complete Tokens in c/c++
Complete Tokens in c/c++
Shobi P P
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
teach4uin
 
Data type in c
Data type in cData type in c
Data type in c
thirumalaikumar3
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
Way2itech
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
naveendnk22
 

What's hot (20)

Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
 
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 Tutorial
C TutorialC Tutorial
C Tutorial
 
C data type format specifier
C data type format specifierC data type format specifier
C data type format specifier
 
Variables and data types in C++
Variables and data types in C++Variables and data types in C++
Variables and data types in C++
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
Data type
Data typeData type
Data type
 
Character set of c
Character set of cCharacter set of c
Character set of c
 
Data Types in C
Data Types in CData Types in C
Data Types in C
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Data types in c language
Data types in c languageData types in c language
Data types in c language
 
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
 
Data type
Data typeData type
Data type
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Complete Tokens in c/c++
Complete Tokens in c/c++Complete Tokens in c/c++
Complete Tokens in c/c++
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 
Data type in c
Data type in cData type in c
Data type in c
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
 

Viewers also liked

literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage
Sahithi Naraparaju
 
Social Media: What it is and what it can do for you
Social Media: What it is and what it can do for youSocial Media: What it is and what it can do for you
Social Media: What it is and what it can do for you
hmetcalf
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
Sahithi Naraparaju
 
17 19 51_09_referat_mpd
17 19 51_09_referat_mpd17 19 51_09_referat_mpd
17 19 51_09_referat_mpd
c00mn
 
OVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAMOVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAM
Sahithi Naraparaju
 
Falsafah pendidikan kebangsaan
Falsafah pendidikan kebangsaanFalsafah pendidikan kebangsaan
Falsafah pendidikan kebangsaanooi Yingfei
 
Gherezghiersamuele20102011 es4
 Gherezghiersamuele20102011 es4 Gherezghiersamuele20102011 es4
Gherezghiersamuele20102011 es4Zemmo90
 
Flick group information (1)
Flick group information (1)Flick group information (1)
Flick group information (1)
Neil Osborne
 
Om&m context
Om&m contextOm&m context
Om&m context
MrLane
 
Flick Lighting Catalogue
Flick Lighting CatalogueFlick Lighting Catalogue
Flick Lighting Catalogue
Neil Osborne
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
Sahithi Naraparaju
 
Ch3
Ch3Ch3
Identity based secure distributed data storage schemes
Identity based secure distributed data storage schemesIdentity based secure distributed data storage schemes
Identity based secure distributed data storage schemes
Sahithi Naraparaju
 
PPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMESPPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMES
Sahithi Naraparaju
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
Sahithi Naraparaju
 
Q canalytic aas2
Q canalytic aas2Q canalytic aas2
Q canalytic aas2
Pepay Galicia
 
Bank management sy stem
Bank management sy stemBank management sy stem
Bank management sy stem
Tashaf Mukhtar
 
pre processor directives in C
pre processor directives in Cpre processor directives in C
pre processor directives in C
Sahithi Naraparaju
 
Srs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemesSrs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemes
Sahithi Naraparaju
 

Viewers also liked (19)

literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage literature survey for identity based secure distributed data storage
literature survey for identity based secure distributed data storage
 
Social Media: What it is and what it can do for you
Social Media: What it is and what it can do for youSocial Media: What it is and what it can do for you
Social Media: What it is and what it can do for you
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
 
17 19 51_09_referat_mpd
17 19 51_09_referat_mpd17 19 51_09_referat_mpd
17 19 51_09_referat_mpd
 
OVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAMOVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAM
 
Falsafah pendidikan kebangsaan
Falsafah pendidikan kebangsaanFalsafah pendidikan kebangsaan
Falsafah pendidikan kebangsaan
 
Gherezghiersamuele20102011 es4
 Gherezghiersamuele20102011 es4 Gherezghiersamuele20102011 es4
Gherezghiersamuele20102011 es4
 
Flick group information (1)
Flick group information (1)Flick group information (1)
Flick group information (1)
 
Om&m context
Om&m contextOm&m context
Om&m context
 
Flick Lighting Catalogue
Flick Lighting CatalogueFlick Lighting Catalogue
Flick Lighting Catalogue
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
 
Ch3
Ch3Ch3
Ch3
 
Identity based secure distributed data storage schemes
Identity based secure distributed data storage schemesIdentity based secure distributed data storage schemes
Identity based secure distributed data storage schemes
 
PPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMESPPT FOR IDBSDDS SCHEMES
PPT FOR IDBSDDS SCHEMES
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
 
Q canalytic aas2
Q canalytic aas2Q canalytic aas2
Q canalytic aas2
 
Bank management sy stem
Bank management sy stemBank management sy stem
Bank management sy stem
 
pre processor directives in C
pre processor directives in Cpre processor directives in C
pre processor directives in C
 
Srs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemesSrs document for identity based secure distributed data storage schemes
Srs document for identity based secure distributed data storage schemes
 

Similar to CONSTANTS, VARIABLES & DATATYPES IN C

C Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptxC Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptx
Murali M
 
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
SowmyaJyothi3
 
C tokens.pptx
C tokens.pptxC tokens.pptx
C tokens.pptx
NavyaParashir
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
nikshaikh786
 
All C ppt.ppt
All C ppt.pptAll C ppt.ppt
All C ppt.ppt
JeelBhanderi4
 
Lec9
Lec9Lec9
Lec9
kapil078
 
Cp presentation
Cp presentationCp presentation
Cp presentation
MeetaPrajapati
 
C language
C languageC language
C language
Rupanshi rawat
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
Anil Dutt
 
lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
AhsanAli64749
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming LanguageCSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
Zubayer Farazi
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Programming in c
Programming in cProgramming in c
Programming in c
vineet4523
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
Eric Chou
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
KRUNAL RAVAL
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
RohanJoshi290109
 
Ch7 Basic Types
Ch7 Basic TypesCh7 Basic Types
Ch7 Basic Types
SzeChingChen
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
RishiBhardwaj65
 
COM1407: Variables and Data Types
COM1407: Variables and Data Types COM1407: Variables and Data Types
COM1407: Variables and Data Types
Hemantha Kulathilake
 
fundamentals of c
fundamentals of cfundamentals of c
fundamentals of c
Vijayalaxmi Wakode
 

Similar to CONSTANTS, VARIABLES & DATATYPES IN C (20)

C Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptxC Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptx
 
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
 
C tokens.pptx
C tokens.pptxC tokens.pptx
C tokens.pptx
 
Module 1:Introduction
Module 1:IntroductionModule 1:Introduction
Module 1:Introduction
 
All C ppt.ppt
All C ppt.pptAll C ppt.ppt
All C ppt.ppt
 
Lec9
Lec9Lec9
Lec9
 
Cp presentation
Cp presentationCp presentation
Cp presentation
 
C language
C languageC language
C language
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
 
CSE 1201: Structured Programming Language
CSE 1201: Structured Programming LanguageCSE 1201: Structured Programming Language
CSE 1201: Structured Programming Language
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Chap 1 and 2
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
 
FUNDAMENTAL OF C
FUNDAMENTAL OF CFUNDAMENTAL OF C
FUNDAMENTAL OF C
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Ch7 Basic Types
Ch7 Basic TypesCh7 Basic Types
Ch7 Basic Types
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
 
COM1407: Variables and Data Types
COM1407: Variables and Data Types COM1407: Variables and Data Types
COM1407: Variables and Data Types
 
fundamentals of c
fundamentals of cfundamentals of c
fundamentals of c
 

More from Sahithi Naraparaju

documentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemesdocumentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemes
Sahithi Naraparaju
 
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
Sahithi Naraparaju
 
over view of viruses
over view of virusesover view of viruses
over view of viruses
Sahithi Naraparaju
 
66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)
Sahithi Naraparaju
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
Sahithi Naraparaju
 
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
Sahithi Naraparaju
 

More from Sahithi Naraparaju (6)

documentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemesdocumentation for identity based secure distrbuted data storage schemes
documentation for identity based secure distrbuted data storage schemes
 
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
SYSTEM ARCHITECTURE / UML DIAGRAMS FOR IDENTITY BASED SECURE DISTRIBUTED DATA...
 
over view of viruses
over view of virusesover view of viruses
over view of viruses
 
66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)66913017 java-ring-1217949449014046-9 (1)
66913017 java-ring-1217949449014046-9 (1)
 
Self protecteion in clustered distributed system new
Self protecteion in clustered distributed system newSelf protecteion in clustered distributed system new
Self protecteion in clustered distributed system new
 
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...A Batch-authenticated And Key AgreementFramework For P2p-based Online Social...
A Batch-authenticated And Key Agreement Framework For P2p-based Online Social...
 

Recently uploaded

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 

CONSTANTS, VARIABLES & DATATYPES IN C

  • 2. INRODUCTION • A programming language is designed to help process certain kinds of data consisting of numbers, characters and strings to provide useful output known as information. • The task of processing of data is accomplished by executing a sequence of precise instructions called program. • These instructions are formed using certain symbols and words according to some rigid rules known as syntax rules.
  • 3. CHARACTER SET: • The characters in C are grouped into following categories: 1) Letters 2) digits 3) special characters 4) white spaces. • Compiler ignores white spaces unless they are part of a string constant. • White spaces may be used to separate words but prohibited between characters of keywords and identifiers.
  • 4. • LETTERS: Uppercase A….Z, lower case a..z. • DIGITS: All decimal digits 0..9 • SPECIAL CHARACTERS: comma(,), period(.), semicolon(;) , colon(:), question mark(?), quotation(“), dollar sign($), slash(/),back slash(), percent sign(%), underscore(_), ampersand(&), asterisk(*), number sign(#). • WHITE SPACES: Blank space, Horizontal tab, Carriage return, Newline, Form feed.
  • 5. Trigraph characters: • C introduces the concept of trigraph sequences to provide a way to enter certain characters that are not available on some keywords. • Each trigraph sequence consists of three characters, 2 question marks followed by another character. • Eg: ??= (number sign), ??)(right bracket]), ??( (left bracket[) , ??! (vertical bar), ??< (left brace {) , ??> (right brace }),??/ (back slash).
  • 6. C tokens: • In a passage of text individual words and punctuation marks are called tokens. • In a C program the smallest individual units known as C tokens. • C has 6 types of tokens namely: 1) Keywords 2) identifiers 3)constants 4)Strings 5)special symbols 6)operators.
  • 7. Keywords and identifiers. • Every C word is classified as either a keyword or an identifier. • All keywords have fixed meanings and these meanings cannot be changed. • Keywords serve as basic building blocks for program statements. • All keywords must be written in lower case. • The underscore character is also permitted in identifiers. • It is usually used a link between two words in long identifiers
  • 8. RULES FOR IDENTIFIERS: 1. 2. 3. 4. 5. First character must be an alphabet. Must consist of only letters, digits or underscore. Only first 31 characters are significant. Cannot use keyword. Must not contain white space.
  • 9. CONSTANTS • Constants refer to fixed values that do not change during the execution of program. INTEGER CONSTANTS: • An integer constant refer to a sequence of digits. • There are 3 types of integers namely: Decimal integer, octal integer and hexadecimal integer. • Decimal integer consist of a set of digits 0 through 9,precceded by an optional – or + sign.
  • 10. • An octal integer constant consist of any combination of digits from the set 0 through 7. with a leading 0 • Eg: 037,0, 0456. • A sequence of digits preceded by 0x or 0X is considered as hexadecimal integer. • They may include alphabets A through F or f. • Letter A through F represents numbesr 10 to 15.
  • 11. REAL CONSTANTS: • To represent quantities that vary continuously real constants are used. • A real number may be expressed in exponential notation. SYNTAX: mantissa e exponent. • Mantissa can be either real number expressed in decimal notation or an integer. • Exponent is an integer number with an optional + or – sign. • The letter ‘e’ separating the mantissa and the exponent, it can be written either lower case or upper case. SYNTAX: 0.65e4,12e-2.
  • 12. • White space is not allowed. • Exponential notation is useful for representing numbers that are either very large or very small in magnitude. • Floating point constants are normally represented as doubleprecision quantities. SINGLE CHARACTER CONSTANTS: • A single character constant contains a single character enclose in a pair of single quote marks. Eg: ‘5’,’x’.
  • 13. • Character constant ‘5’ is not same as number 5. • Character constants have integer values known as ASCII values. • Statement: printf (“%d”, ’a’); would print number 97, the ASCII value of letter ‘a’. • Since each character constant represent an integer value, it is possible to perform arithmetic operations on character constants.
  • 14. STRING CONSTANTS: • A string constant is a sequence of characters enclosed in double quotes. • Characters may be letters, numbers, special characters and blank spaces. Eg: “hello” , “1987”, “?...!”. • Character constant is not equivalent to single character string constant. .
  • 15. BACK SLASH CHARACTER CONSTANTS: • C supports some special back slash character constants that are used in output functions. • These characters combinations are known as escape sequences. • Back slash character constants are: ‘a’ audible alert; ‘b’ backspace; ‘f’ form feed; ‘n’ newline; ‘r’ carriage return; ‘t’ horizontal tab; ‘v’ vertical tab; ‘”single quote, ‘?’ question mark; ‘’ backslash; ‘0’ null.
  • 16. VARIABLES • A variable is a data name that may be used to store a data value. • A variable may take different values at different times during execution. • A variable can be chosen by the programmer in a meaningful way. CONDITIONS FOR SPECIFYING VARIABLES: 1. They must begin with a letter. Some systems may permit underscore as first character.
  • 17. 1. Uppercase and lowercase are significant. The variable TOTAL is different from total and Total. 2. It should not be keyword. 3. Whitespace is not allowed. 4. Length should be normally more than 8 characters are treated as significant by many compilers. • Examples of valid variables are: john, x1,T_raise, first_tag. • Examples of invalid variables are: 123,(area),25th,price$, %.
  • 18. DATATYPES • C language is rich in its data types. • Storage representations and machine instructions to handle constants differ from machine to machine. • The variety of datatypes allow to select the type appropriate to the needs of the application as well as machine. • C supports 3 classes of datatypes: 1)Primary datatypes 2) derived datatypes 3)derived datatypes.
  • 19. • All C compilers support 5 fundamental datatypes namely: integer (int), character (char), floating point (float), doubleprecision floating point (double) and void. • Many of them also offer extended datatypes such as long int, int ,long double. Data type Range of values char -128 to 127 int -32768 to 32767 float -3.4e+8 to 3.4e+8 double 1.7e-308 to 1.7e+308.
  • 20. INTEGER TYPES: • Integers are whole numbers with a range of values supported by particular machine. • Integers occupy one word storage generally and since the word sizes of machine vary the size of integer that can be stored depends on computer. • If we use 16-bit word length, the size of integer value is limited to range -32768 to 32767. • If we use 32-bit word length can store an integer ranging from -2147483648 to 2147483647.
  • 21. • In order to provide control over range of numbers and storage space C has 3 classes of integer storage namely: short int, int, long int in both signed and unsigned. • Short int represents fairly small integer values and requires half amount as regular int number uses. FLOATING POINT TYPE: • Floating point numbers are stored in 32bits, with 6 digit precision. • Floating point numbers are defined by keyword “float”.
  • 22. • When accuracy is provided by a float number is not sufficient, double can be used to define number. • A double datatype number uses 64 bits giving a precision of 14 digits. • These are known as double precision number. • Double datatype represent the same datatype that float represents but with greater precision. • To extend the precision we may use long double which uses 80 bits.
  • 23. VOID TYPES: • Void type has no values. This is used to specify the type of functions. • The type of function is said to be void when it doesn't return any value to the calling function. CHARACTER TYPES: • A single character can be defined as a character (char) type data. • Characters are usually store in one byte of internal storage. • Qualifier signed or unsigned may be used in char explicitly. Unsigned characters have values between 0 and 255, signed characters have values from -128 to 127