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

Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
Dr. Rupinder Singh
 
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
 
Intoduction to structure
Intoduction to structureIntoduction to structure
Intoduction to structure
Utsav276
 
C programming
C programmingC programming
File handling in c
File handling in cFile handling in c
File handling in c
aakanksha s
 
computer organization and assembly language Lec 01 coal_introduction
computer organization and assembly language  Lec 01 coal_introductioncomputer organization and assembly language  Lec 01 coal_introduction
computer organization and assembly language Lec 01 coal_introduction
Zia3130
 
Python reading and writing files
Python reading and writing filesPython reading and writing files
Python reading and writing files
Mukesh Tekwani
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c language
Tanmay Modi
 
structured programming
structured programmingstructured programming
structured programming
Ahmad54321
 
Managing I/O operations In C- Language
Managing I/O operations In C- LanguageManaging I/O operations In C- Language
Managing I/O operations In C- Language
RavindraSalunke3
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar
 
Compiler: Programming Language= Assignments and statements
Compiler: Programming Language= Assignments and statementsCompiler: Programming Language= Assignments and statements
Compiler: Programming Language= Assignments and statements
Geo Marian
 
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
 
What is token c programming
What is token c programmingWhat is token c programming
What is token c programming
Rumman Ansari
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
Sunil OS
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
Nilesh Dalvi
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
Hajar Len
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
Appili Vamsi Krishna
 
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
Hemantha Kulathilake
 
Managing input and output operation in c
Managing input and output operation in cManaging input and output operation in c
Managing input and output operation in c
yazad dumasia
 

What's hot (20)

Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
 
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
 
Intoduction to structure
Intoduction to structureIntoduction to structure
Intoduction to structure
 
C programming
C programmingC programming
C programming
 
File handling in c
File handling in cFile handling in c
File handling in c
 
computer organization and assembly language Lec 01 coal_introduction
computer organization and assembly language  Lec 01 coal_introductioncomputer organization and assembly language  Lec 01 coal_introduction
computer organization and assembly language Lec 01 coal_introduction
 
Python reading and writing files
Python reading and writing filesPython reading and writing files
Python reading and writing files
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c language
 
structured programming
structured programmingstructured programming
structured programming
 
Managing I/O operations In C- Language
Managing I/O operations In C- LanguageManaging I/O operations In C- Language
Managing I/O operations In C- Language
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
 
Compiler: Programming Language= Assignments and statements
Compiler: Programming Language= Assignments and statementsCompiler: Programming Language= Assignments and statements
Compiler: Programming Language= Assignments and statements
 
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
 
What is token c programming
What is token c programmingWhat is token c programming
What is token c programming
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
 
Managing input and output operation in c
Managing input and output operation in cManaging input and output operation in c
Managing input and output operation in c
 

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
 
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
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
Abhishek Sinha
 
Input And Output
 Input And Output Input And Output
Input And Output
Ghaffar Khan
 
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 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
 
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
 
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
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
atulchaudhary821
 
7512635.ppt
7512635.ppt7512635.ppt
7512635.ppt
ssuserda85e6
 

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
 
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]
 
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
 
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
 
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
 
(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt(Lect. 2 & 3) Introduction to C.ppt
(Lect. 2 & 3) Introduction to C.ppt
 
7512635.ppt
7512635.ppt7512635.ppt
7512635.ppt
 

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

Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 

Recently uploaded (20)

Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 

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