SlideShare a Scribd company logo
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

More Related Content

What's hot

Unit4
Unit4Unit4
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
Thesis Scientist Private Limited
 
File in c
File in cFile in c
File in c
Prabhu Govind
 
Pre processor directives in c
Pre processor directives in cPre processor directives in c
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
Hemantha Kulathilake
 
Functions in C
Functions in CFunctions in C
Functions in C
Shobhit Upadhyay
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
Function in C
Function in CFunction in C
Function in C
Dr. Abhineet Anand
 
Function in C program
Function in C programFunction in C program
Function in C program
Nurul Zakiah Zamri Tan
 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5
Vikram Nandini
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
Dipta Saha
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
programming9
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
Tasnima Hamid
 
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
SowmyaJyothi3
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
Rumman Ansari
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
Nitesh Bichwani
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Aniket Patne
 
Function in c
Function in cFunction in c
Function in c
Raj Tandukar
 
C function presentation
C function presentationC function presentation
C function presentation
Touhidul Shawan
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
Ashim Lamichhane
 

What's hot (20)

Unit4
Unit4Unit4
Unit4
 
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
 
File in c
File in cFile in c
File in c
 
Pre processor directives in c
Pre processor directives in cPre processor directives in c
Pre processor directives in c
 
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
 
Function in C
Function in CFunction in C
Function in C
 
Function in C program
Function in C programFunction in C program
Function in C program
 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
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
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Function in c
Function in cFunction in c
Function in c
 
C function presentation
C function presentationC function presentation
C function presentation
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 

Viewers also liked

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

Viewers also liked (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 to 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 Function
imtiazalijoono
 
CHAPTER 4
CHAPTER 4CHAPTER 4
CHAPTER 4
mohd_mizan
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
Abhishek Sinha
 
C Basics
C BasicsC Basics
C Basics
Sunil OS
 
Input And Output
 Input And Output Input And Output
Input And Output
Ghaffar Khan
 
Input Output function in c programing language.pptx
Input  Output function in c programing language.pptxInput  Output function in c programing language.pptx
Input Output function in c programing language.pptx
amit0815q
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
REHAN IJAZ
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
Md. Imran Hossain Showrov
 
Chapter3
Chapter3Chapter3
Chapter3
Kamran
 
Presention programming
Presention programmingPresention programming
Presention programming
saleha iqbal
 
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
niyamathShariff
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
indrasir
 
2 data and c
2 data and c2 data and c
2 data and c
MomenMostafa
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
simranjotsingh2908
 
Programming in C.pptx
Programming in C.pptxProgramming in C.pptx
Programming in C.pptx
TeresitaDapulase
 
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
AnkitaVerma776806
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
RohitRaj744272
 
Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
Dr. Rupinder Singh
 
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
ssuserf86fba
 
Cse115 lecture04introtoc programming
Cse115 lecture04introtoc programmingCse115 lecture04introtoc programming
Cse115 lecture04introtoc programming
Md. Ashikur Rahman
 

Similar to 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
 
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
 
Input Output function in c programing language.pptx
Input  Output function in c programing language.pptxInput  Output function in c programing language.pptx
Input Output function in c programing language.pptx
 
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
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
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
 
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
 
Cse115 lecture04introtoc programming
Cse115 lecture04introtoc programmingCse115 lecture04introtoc programming
Cse115 lecture04introtoc programming
 

More from Sabik T S

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

More from 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
 

Recently uploaded

FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.pptFIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
ashutoshklal29
 
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
Alvaro Barbosa
 
3. Maturity_indices_of_fruits_and_vegetable.pptx
3. Maturity_indices_of_fruits_and_vegetable.pptx3. Maturity_indices_of_fruits_and_vegetable.pptx
3. Maturity_indices_of_fruits_and_vegetable.pptx
UmeshTimilsina1
 
MathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptxMathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptx
nolicaliso1
 
5. Postharvest deterioration of fruits and vegetables.pptx
5. Postharvest deterioration of fruits and vegetables.pptx5. Postharvest deterioration of fruits and vegetables.pptx
5. Postharvest deterioration of fruits and vegetables.pptx
UmeshTimilsina1
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
Nguyen Thanh Tu Collection
 
7. Post Harvest Entomology and their control.pptx
7. Post Harvest Entomology and their control.pptx7. Post Harvest Entomology and their control.pptx
7. Post Harvest Entomology and their control.pptx
UmeshTimilsina1
 
C Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdfC Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdf
Scholarhat
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
AnujVishwakarma34
 
JavaScript Interview Questions PDF By ScholarHat
JavaScript Interview  Questions PDF By ScholarHatJavaScript Interview  Questions PDF By ScholarHat
JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
Open Source and AI - ByWater Closing Keynote Presentation.pdf
Open Source and AI - ByWater Closing Keynote Presentation.pdfOpen Source and AI - ByWater Closing Keynote Presentation.pdf
Open Source and AI - ByWater Closing Keynote Presentation.pdf
Jessica Zairo
 
Dot NET Interview Questions PDF By ScholarHat
Dot NET Interview Questions PDF By ScholarHatDot NET Interview Questions PDF By ScholarHat
Dot NET Interview Questions PDF By ScholarHat
Scholarhat
 
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
ALBERTHISOLER1
 
11. Post harvest quality, Quality criteria and Judgement.pptx
11. Post harvest quality, Quality criteria and Judgement.pptx11. Post harvest quality, Quality criteria and Judgement.pptx
11. Post harvest quality, Quality criteria and Judgement.pptx
UmeshTimilsina1
 
INSIDE OUT - PowerPoint Presentation.pptx
INSIDE OUT - PowerPoint Presentation.pptxINSIDE OUT - PowerPoint Presentation.pptx
INSIDE OUT - PowerPoint Presentation.pptx
RODELAZARES3
 
How To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-marketHow To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-market
Sikandar Ali
 
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa
 
E-learning Odoo 17 New features - Odoo 17 Slides
E-learning Odoo 17  New features - Odoo 17 SlidesE-learning Odoo 17  New features - Odoo 17 Slides
E-learning Odoo 17 New features - Odoo 17 Slides
Celine George
 
A beginner’s guide to project reviews - everything you wanted to know but wer...
A beginner’s guide to project reviews - everything you wanted to know but wer...A beginner’s guide to project reviews - everything you wanted to know but wer...
A beginner’s guide to project reviews - everything you wanted to know but wer...
Association for Project Management
 
DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008
Glenn Rivera
 

Recently uploaded (20)

FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.pptFIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
FIRST AID PRESENTATION ON INDUSTRIAL SAFETY by dr lal.ppt
 
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
Benchmarking Sustainability: Neurosciences and AI Tech Research in Macau - Ke...
 
3. Maturity_indices_of_fruits_and_vegetable.pptx
3. Maturity_indices_of_fruits_and_vegetable.pptx3. Maturity_indices_of_fruits_and_vegetable.pptx
3. Maturity_indices_of_fruits_and_vegetable.pptx
 
MathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptxMathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptx
 
5. Postharvest deterioration of fruits and vegetables.pptx
5. Postharvest deterioration of fruits and vegetables.pptx5. Postharvest deterioration of fruits and vegetables.pptx
5. Postharvest deterioration of fruits and vegetables.pptx
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
 
7. Post Harvest Entomology and their control.pptx
7. Post Harvest Entomology and their control.pptx7. Post Harvest Entomology and their control.pptx
7. Post Harvest Entomology and their control.pptx
 
C Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdfC Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdf
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
 
JavaScript Interview Questions PDF By ScholarHat
JavaScript Interview  Questions PDF By ScholarHatJavaScript Interview  Questions PDF By ScholarHat
JavaScript Interview Questions PDF By ScholarHat
 
Open Source and AI - ByWater Closing Keynote Presentation.pdf
Open Source and AI - ByWater Closing Keynote Presentation.pdfOpen Source and AI - ByWater Closing Keynote Presentation.pdf
Open Source and AI - ByWater Closing Keynote Presentation.pdf
 
Dot NET Interview Questions PDF By ScholarHat
Dot NET Interview Questions PDF By ScholarHatDot NET Interview Questions PDF By ScholarHat
Dot NET Interview Questions PDF By ScholarHat
 
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
 
11. Post harvest quality, Quality criteria and Judgement.pptx
11. Post harvest quality, Quality criteria and Judgement.pptx11. Post harvest quality, Quality criteria and Judgement.pptx
11. Post harvest quality, Quality criteria and Judgement.pptx
 
INSIDE OUT - PowerPoint Presentation.pptx
INSIDE OUT - PowerPoint Presentation.pptxINSIDE OUT - PowerPoint Presentation.pptx
INSIDE OUT - PowerPoint Presentation.pptx
 
How To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-marketHow To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-market
 
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
Dr. Nasir Mustafa CERTIFICATE OF APPRECIATION "NEUROANATOMY"
 
E-learning Odoo 17 New features - Odoo 17 Slides
E-learning Odoo 17  New features - Odoo 17 SlidesE-learning Odoo 17  New features - Odoo 17 Slides
E-learning Odoo 17 New features - Odoo 17 Slides
 
A beginner’s guide to project reviews - everything you wanted to know but wer...
A beginner’s guide to project reviews - everything you wanted to know but wer...A beginner’s guide to project reviews - everything you wanted to know but wer...
A beginner’s guide to project reviews - everything you wanted to know but wer...
 
DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008
 

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);