SlideShare una empresa de Scribd logo
1 de 14
DATA INPUT AND OUTPUT
INPUT/OUTPUT IN C
 C has no built-in statements for input or output.
 A library of functions is supplied to perform
these operations. The I/O library functions are
listed the “header” file <stdio.h>.
 You do not need to memorize them, just be
familiar with them.
STREAMS
 All input and output is performed with streams.
 A "stream" is a sequence of characters
organized into lines.
 Each line consists of zero or more characters
and ends with the "newline" character.
TYPES OF STREAMS IN C
 Standard input stream is called "stdin" and is
normally connected to the keyboard
 Standard output stream is called "stdout" and
is normally connected to the display screen.
 Standard error stream is called "stderr" and is
also normally connected to the screen
I/O FUNCTIONS IN C
 There are six i/o functions in C are:
 1. getchar()
 2. putchar()
 3. printf()
 4.scanf()
 5.gets()
 6.puts()
GETCHAR()
 getchar();
 Single character can be entered in computer
using C.
 Example:
 Char c;
 …………
 …….
 C=getchar();
PUTCHAR()
 putchar();
 It is used to display single char.
 Example
char c=‘H’;
putchar(c);
SCANF
scanf ( ) ;
 This function provides for formatted input from the
keyboard. The syntax is:
scanf ( “format” , &var1, &var2, …) ;
 The “format” is a listing of the data types of the
variables to be input and the & in front of each
variable name tells the system WHERE to store the
value that is input. It provides the address for the
variable.
 Example:
float a; int b;
scanf (“%f%d”, &a, &b
FORMAT OF DATA
 Format Conversion Specifiers:
d -- displays a decimal (base 10) integer
l -- used with other specifies to indicate a "long"
e -- displays a floating point value in exponential
notation
f -- displays a floating point value
g -- displays a number in either "e" or "f" format
c -- displays a single character
s -- displays a string of characters
STRINGS
 When you enter string data the compiler
automatically add 0 in the end of string;
 Char name[22];
 gets(name);
 ‘ROHIT’
 But actual value stored in computer is
‘ROHIT0’
PRINTF
 This function provides for formatted output to
the screen. The syntax is:
printf ( “format”, var1, var2, … ) ;
 The “format” includes a listing of the data types
of the variables to be output and, optionally,
some text and control character(s).
 Example:
float a ; int b ;
scanf ( “%f%d”, &a, &b ) ;
printf ( “You entered %f and %d n”, a, b ) ;
GETS AND PUTS
 To input a string to computer
 gets(name);
 Puts is used to display string data on screen
 puts(name);
ANY QUESTIONS
THANK YOU
With regards
slideshare.net/sabik.sabz

Más contenido relacionado

La actualidad más candente

Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocationViji B
 
Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Handling of character strings C programming
Handling of character strings C programmingHandling of character strings C programming
Handling of character strings C programmingAppili Vamsi Krishna
 
File Management in C
File Management in CFile Management in C
File Management in CPaurav Shah
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and outputOnline
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and StringTasnima Hamid
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++Neeru Mittal
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in cniyamathShariff
 
Types of function call
Types of function callTypes of function call
Types of function callArijitDhali
 
Strings in C language
Strings in C languageStrings in C language
Strings in C languageP M Patil
 

La actualidad más candente (20)

C++
C++C++
C++
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
C functions
C functionsC functions
C functions
 
Storage class in C Language
Storage class in C LanguageStorage class in C Language
Storage class in C Language
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Handling of character strings C programming
Handling of character strings C programmingHandling of character strings C programming
Handling of character strings C programming
 
Functions in C
Functions in CFunctions in C
Functions in C
 
File Management in C
File Management in CFile Management in C
File Management in C
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and output
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
Types of function call
Types of function callTypes of function call
Types of function call
 
Functions in c
Functions in cFunctions in c
Functions in c
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
Strings in C language
Strings in C languageStrings in C language
Strings in C language
 

Destacado (17)

DATA PROCESSING
DATA PROCESSINGDATA PROCESSING
DATA PROCESSING
 
Presentation Skills For MARKETING Managers
Presentation Skills For MARKETING ManagersPresentation Skills For MARKETING Managers
Presentation Skills For MARKETING Managers
 
Marketing strategy ppt slides
Marketing strategy ppt slidesMarketing strategy ppt slides
Marketing strategy ppt slides
 
Customer Equity
Customer EquityCustomer Equity
Customer Equity
 
Marketing plan ppt slides
Marketing plan ppt slidesMarketing plan ppt slides
Marketing plan ppt slides
 
Strategy Execution
Strategy Execution Strategy Execution
Strategy Execution
 
Customer Service Strategy
Customer Service StrategyCustomer Service Strategy
Customer Service Strategy
 
Innovation Strategy
Innovation StrategyInnovation Strategy
Innovation Strategy
 
Creative Thinking Skills
Creative Thinking SkillsCreative Thinking Skills
Creative Thinking Skills
 
Blue ocean strategy ppt slides
Blue ocean strategy ppt slidesBlue ocean strategy ppt slides
Blue ocean strategy ppt slides
 
Marketing Management
Marketing ManagementMarketing Management
Marketing Management
 
Strategic Planning For Managers
Strategic Planning For Managers   Strategic Planning For Managers
Strategic Planning For Managers
 
52 Types of Marketing Strategies
52 Types of Marketing Strategies52 Types of Marketing Strategies
52 Types of Marketing Strategies
 
Brand Strategy
Brand StrategyBrand Strategy
Brand Strategy
 
New Product Development Strategy
New Product Development StrategyNew Product Development Strategy
New Product Development Strategy
 
Marketing Strategy
Marketing StrategyMarketing Strategy
Marketing Strategy
 
Managing Customer Service
Managing Customer Service  Managing Customer Service
Managing Customer Service
 

Similar a Data Input and Output

Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 
Presention programming
Presention programmingPresention programming
Presention programmingsaleha iqbal
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Input and Output In C Language
Input and Output In C LanguageInput and Output In C Language
Input and Output In C LanguageAdnan Khan
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxAnkitaVerma776806
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptxRohitRaj744272
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesssuserf86fba
 

Similar a Data Input and Output (20)

Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
CHAPTER 4
CHAPTER 4CHAPTER 4
CHAPTER 4
 
Introduction to Input/Output Functions in C
Introduction to Input/Output Functions in CIntroduction to Input/Output Functions in C
Introduction to Input/Output Functions in C
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
C Basics
C BasicsC Basics
C Basics
 
Input And Output
 Input And Output Input And Output
Input And Output
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
 
Chapter3
Chapter3Chapter3
Chapter3
 
Presention programming
Presention programmingPresention programming
Presention programming
 
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
2 data and c
2 data and c2 data and c
2 data and c
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
Programming in C.pptx
Programming in C.pptxProgramming in C.pptx
Programming in C.pptx
 
Input and Output In C Language
Input and Output In C LanguageInput and Output In C Language
Input and Output In C Language
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequences
 

Más de Sabik T S

Managers roles and skills
Managers roles and skillsManagers roles and skills
Managers roles and skillsSabik T S
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingSabik T S
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSabik T S
 
decision table training session
decision table training sessiondecision table training session
decision table training sessionSabik T S
 
cover letter
cover lettercover letter
cover letterSabik T S
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basicsSabik T S
 
Types of welding
Types of welding Types of welding
Types of welding Sabik T S
 

Más de Sabik T S (7)

Managers roles and skills
Managers roles and skillsManagers roles and skills
Managers roles and skills
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
decision table training session
decision table training sessiondecision table training session
decision table training session
 
cover letter
cover lettercover letter
cover letter
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basics
 
Types of welding
Types of welding Types of welding
Types of welding
 

Último

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Último (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

Data Input and Output

  • 1. DATA INPUT AND OUTPUT
  • 2. INPUT/OUTPUT IN C  C has no built-in statements for input or output.  A library of functions is supplied to perform these operations. The I/O library functions are listed the “header” file <stdio.h>.  You do not need to memorize them, just be familiar with them.
  • 3. STREAMS  All input and output is performed with streams.  A "stream" is a sequence of characters organized into lines.  Each line consists of zero or more characters and ends with the "newline" character.
  • 4. TYPES OF STREAMS IN C  Standard input stream is called "stdin" and is normally connected to the keyboard  Standard output stream is called "stdout" and is normally connected to the display screen.  Standard error stream is called "stderr" and is also normally connected to the screen
  • 5. I/O FUNCTIONS IN C  There are six i/o functions in C are:  1. getchar()  2. putchar()  3. printf()  4.scanf()  5.gets()  6.puts()
  • 6. GETCHAR()  getchar();  Single character can be entered in computer using C.  Example:  Char c;  …………  …….  C=getchar();
  • 7. PUTCHAR()  putchar();  It is used to display single char.  Example char c=‘H’; putchar(c);
  • 8. SCANF scanf ( ) ;  This function provides for formatted input from the keyboard. The syntax is: scanf ( “format” , &var1, &var2, …) ;  The “format” is a listing of the data types of the variables to be input and the & in front of each variable name tells the system WHERE to store the value that is input. It provides the address for the variable.  Example: float a; int b; scanf (“%f%d”, &a, &b
  • 9. FORMAT OF DATA  Format Conversion Specifiers: d -- displays a decimal (base 10) integer l -- used with other specifies to indicate a "long" e -- displays a floating point value in exponential notation f -- displays a floating point value g -- displays a number in either "e" or "f" format c -- displays a single character s -- displays a string of characters
  • 10. STRINGS  When you enter string data the compiler automatically add 0 in the end of string;  Char name[22];  gets(name);  ‘ROHIT’  But actual value stored in computer is ‘ROHIT0’
  • 11. PRINTF  This function provides for formatted output to the screen. The syntax is: printf ( “format”, var1, var2, … ) ;  The “format” includes a listing of the data types of the variables to be output and, optionally, some text and control character(s).  Example: float a ; int b ; scanf ( “%f%d”, &a, &b ) ; printf ( “You entered %f and %d n”, a, b ) ;
  • 12. GETS AND PUTS  To input a string to computer  gets(name);  Puts is used to display string data on screen  puts(name);