SlideShare a Scribd company logo
DATA TYPES, KEYWORDS,
INPUT/OUTPUT AND FORMAT
SPECIFIERS
DATA TYPES
• Data types in c refer to an extensive system used for declaring
variables or functions of different types.
• The type of a variable determines how much space it occupies in
storage and how the bit pattern stored is interpreted.
BASIC DATA TYPES
• The basic data types are integer-based and floating-point based. C
language supports both signed and unsigned literals.
Data Types Memory
Size
unsigned signed
char 1 byte 0 to 255 −128 to 127
short 2 byte 0 to 65,535 -32,768 to 32,767
int 2 byte 0 to 65,535 −32,768 to 32,767
float 4 byte 1.2E-38 to 3.4E+38
double 8 byte 2.3E-308 to 1.7E+308
long double 10 byte 3.4E-4932 to 1.1E+4932
VOID DATA TYPES
• The void type specifies that no value is available. It is used in three
kinds of situations −
• Function returns as void: A function with no return value has the
return type as void. For example, void exit (int status);
• Function arguments as void: A function with no parameter can
accept a void. For example, int rand(void);
• Pointers to void: A pointer of type void * represents the address of an
object, but not its type. For example, a memory allocation
function void *malloc( size_t size ); returns a pointer to void which
can be casted to any data type.
KEYWORDS
• A keyword is a reserved word. You cannot use it as a variable name,
constant name, etc. There are only 32 reserved words (keywords) in
the C language.
INPUT AND OUTPUT
• C language has standard libraries that allow input and output in a
program.
• The stdio.h or standard input output library in C that has methods for
input and output.
• scanf(): The scanf() method, in C, reads the value from the console as per
the type specified. Syntax:
scanf(“%X”, &variableOfXType);
• printf(): The printf() method, in C, prints the value passed as the
parameter to it, on the console screen. Syntax:
printf(“%X”, variableOfXType);
FORMAT SPECIFIERS
• The format specifiers are used in
C for input and output purposes.
• Using this concept the compiler
can understand that what type of
data is in a variable during taking
input using the scanf() function
and printing using printf()
function.
Format Specifier Type
%c Character
%d Signed integer
%f Float values
%l or %ld or %li Long
%lf Double
%s String
%p Pointer

More Related Content

PPTX
C programming tutorial for Beginner
sophoeutsen2
 
PDF
introduction to programming using ANSI C
JNTUK KAKINADA
 
PPTX
Unit No 2.pptx Basic s of C Programming
Vaibhav Parjane
 
PPTX
c_pro_introduction.pptx
RohitRaj744272
 
PPTX
Fundamentals of Programming Constructs.pptx
vijayapraba1
 
DOCX
Complete c programming presentation
nadim akber
 
PPTX
C language
Mukul Kirti Verma
 
PPTX
CHAPTER 4
mohd_mizan
 
C programming tutorial for Beginner
sophoeutsen2
 
introduction to programming using ANSI C
JNTUK KAKINADA
 
Unit No 2.pptx Basic s of C Programming
Vaibhav Parjane
 
c_pro_introduction.pptx
RohitRaj744272
 
Fundamentals of Programming Constructs.pptx
vijayapraba1
 
Complete c programming presentation
nadim akber
 
C language
Mukul Kirti Verma
 
CHAPTER 4
mohd_mizan
 

Similar to DATATYPES,KEYWORDS,FORMATSPECS[1].pptx (20)

PPTX
unit 1 cpds.pptx
madhurij54
 
PPTX
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
EG20910848921ISAACDU
 
RTF
over all view programming to computer
muniryaseen
 
PDF
Data structure & Algorithms - Programming in C
babuk110
 
PPTX
LESSON1-C_programming (1).GRADE 8 LESSONpptx
joachimbenedicttulau
 
PPTX
C programming
KarthicaMarasamy
 
PPT
CONSTANTS, VARIABLES & DATATYPES IN C
Sahithi Naraparaju
 
PPT
constants, variables and datatypes in C
Sahithi Naraparaju
 
PPTX
Data Input and Output
Sabik T S
 
PPTX
2. introduction of a c program
Alamgir Hossain
 
PPTX
C Programming : data types and types of variable.pptx
DHIVYAB17
 
PPTX
C language
marar hina
 
PPTX
Introduction to C Unit 1
Dr. SURBHI SAROHA
 
PPTX
c-introduction.pptx
Mangala R
 
PDF
C programming language
Mahmoud Eladawi
 
PDF
Reduce course notes class xii
Syed Zaid Irshad
 
PPTX
C tokens
Megha Sharma
 
PPTX
Lec 02 Introduction to C Programming.pptx
warriorbotscomp
 
PPTX
Datatype and Operators used in C Programming
Rhishav Poudyal
 
unit 1 cpds.pptx
madhurij54
 
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
EG20910848921ISAACDU
 
over all view programming to computer
muniryaseen
 
Data structure & Algorithms - Programming in C
babuk110
 
LESSON1-C_programming (1).GRADE 8 LESSONpptx
joachimbenedicttulau
 
C programming
KarthicaMarasamy
 
CONSTANTS, VARIABLES & DATATYPES IN C
Sahithi Naraparaju
 
constants, variables and datatypes in C
Sahithi Naraparaju
 
Data Input and Output
Sabik T S
 
2. introduction of a c program
Alamgir Hossain
 
C Programming : data types and types of variable.pptx
DHIVYAB17
 
C language
marar hina
 
Introduction to C Unit 1
Dr. SURBHI SAROHA
 
c-introduction.pptx
Mangala R
 
C programming language
Mahmoud Eladawi
 
Reduce course notes class xii
Syed Zaid Irshad
 
C tokens
Megha Sharma
 
Lec 02 Introduction to C Programming.pptx
warriorbotscomp
 
Datatype and Operators used in C Programming
Rhishav Poudyal
 

More from SKUP1 (20)

PPTX
serial_busses_i2c.pptx
SKUP1
 
PPTX
DESIGN PATTERN.pptx
SKUP1
 
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
SKUP1
 
PPTX
DATA STRUCTURES AND LINKED LISTS IN C.pptx
SKUP1
 
PPTX
C-Programming File-handling-C.pptx
SKUP1
 
PPTX
Processes, Threads.pptx
SKUP1
 
PPTX
C-Programming Control statements.pptx
SKUP1
 
PPTX
Finite State Machine.ppt.pptx
SKUP1
 
PPTX
FUNCTIONS IN C.pptx
SKUP1
 
PPTX
cprogramming strings.pptx
SKUP1
 
PPTX
UNIONS IN C.pptx
SKUP1
 
PPTX
OPERATORS IN C.pptx
SKUP1
 
PPTX
cprogramming Structures.pptx
SKUP1
 
PPTX
C-Programming Function pointers.pptx
SKUP1
 
PPTX
POINTERS.pptx
SKUP1
 
PPTX
STACKS AND QUEUES.pptx
SKUP1
 
PPTX
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
SKUP1
 
PPTX
C MEMORY MODEL​.pptx
SKUP1
 
PPTX
DYNAMIC MEMORY ALLOCATION.pptx
SKUP1
 
PPTX
COMPILATION PROCESS IN C.pptx
SKUP1
 
serial_busses_i2c.pptx
SKUP1
 
DESIGN PATTERN.pptx
SKUP1
 
INTER PROCESS COMMUNICATION (IPC).pptx
SKUP1
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
SKUP1
 
C-Programming File-handling-C.pptx
SKUP1
 
Processes, Threads.pptx
SKUP1
 
C-Programming Control statements.pptx
SKUP1
 
Finite State Machine.ppt.pptx
SKUP1
 
FUNCTIONS IN C.pptx
SKUP1
 
cprogramming strings.pptx
SKUP1
 
UNIONS IN C.pptx
SKUP1
 
OPERATORS IN C.pptx
SKUP1
 
cprogramming Structures.pptx
SKUP1
 
C-Programming Function pointers.pptx
SKUP1
 
POINTERS.pptx
SKUP1
 
STACKS AND QUEUES.pptx
SKUP1
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
SKUP1
 
C MEMORY MODEL​.pptx
SKUP1
 
DYNAMIC MEMORY ALLOCATION.pptx
SKUP1
 
COMPILATION PROCESS IN C.pptx
SKUP1
 

Recently uploaded (20)

PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
Zero Carbon Building Performance standard
BassemOsman1
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 

DATATYPES,KEYWORDS,FORMATSPECS[1].pptx

  • 1. DATA TYPES, KEYWORDS, INPUT/OUTPUT AND FORMAT SPECIFIERS
  • 2. DATA TYPES • Data types in c refer to an extensive system used for declaring variables or functions of different types. • The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.
  • 3. BASIC DATA TYPES • The basic data types are integer-based and floating-point based. C language supports both signed and unsigned literals. Data Types Memory Size unsigned signed char 1 byte 0 to 255 −128 to 127 short 2 byte 0 to 65,535 -32,768 to 32,767 int 2 byte 0 to 65,535 −32,768 to 32,767 float 4 byte 1.2E-38 to 3.4E+38 double 8 byte 2.3E-308 to 1.7E+308 long double 10 byte 3.4E-4932 to 1.1E+4932
  • 4. VOID DATA TYPES • The void type specifies that no value is available. It is used in three kinds of situations − • Function returns as void: A function with no return value has the return type as void. For example, void exit (int status); • Function arguments as void: A function with no parameter can accept a void. For example, int rand(void); • Pointers to void: A pointer of type void * represents the address of an object, but not its type. For example, a memory allocation function void *malloc( size_t size ); returns a pointer to void which can be casted to any data type.
  • 5. KEYWORDS • A keyword is a reserved word. You cannot use it as a variable name, constant name, etc. There are only 32 reserved words (keywords) in the C language.
  • 6. INPUT AND OUTPUT • C language has standard libraries that allow input and output in a program. • The stdio.h or standard input output library in C that has methods for input and output. • scanf(): The scanf() method, in C, reads the value from the console as per the type specified. Syntax: scanf(“%X”, &variableOfXType); • printf(): The printf() method, in C, prints the value passed as the parameter to it, on the console screen. Syntax: printf(“%X”, variableOfXType);
  • 7. FORMAT SPECIFIERS • The format specifiers are used in C for input and output purposes. • Using this concept the compiler can understand that what type of data is in a variable during taking input using the scanf() function and printing using printf() function. Format Specifier Type %c Character %d Signed integer %f Float values %l or %ld or %li Long %lf Double %s String %p Pointer