SlideShare a Scribd company logo
1 of 25
1. Introduction
2. Header Files
3. Unformatted input
function
4. Formatted input function
5. Unformatted output
function
6. Formatted output
function
Usually higher-level programs
language like C,java,etc..does
not have any build-in
Input/Output statement as
part of syntax.
Therefore we use to file
which has Input/Output
function.
Thus, we make header file
which I/O function when it
required.
The value assigned for first time
to any variable is called
initialization.
When we want to use library
functions, it is required to include
respective library in the program.
The value assigned for first
time to any variable is called
initialization.
When we want to use library
functions, it is required to
include respective library in the
program.
C is functional languages, so
for accepting input and
printing output. There must
provides readymade functions.
Maximum input and output
are define in header files
name in C is stdio.h .
Stdio.h (standard input-
output header file) included
function like
get(c),getchar(),gets(),printf()
,put(c),putchar,puts(),scanf(),
etc.
Other header files were
1. <ctype.h> :- Character
testing and conversion
function
2. <math.h> :-Mathematical
function
3. <string.h> :-String
manipulation
Getchar() function
 It is used to accept a
character in a C program.
Its standard form is
Syntax :
variable_name =getchar();
Getchar() function
When getchar() function will be
encountered by C compiler while
executing a program , the
program will wait for the user to
press a key from the keyboard.
The character keyword in from
the keyword will be enclose on
the screen.
Getche() function
This function is used to take
a character from consol.
It is included in conio.h
Header file.
Getch() function
This function is used for
inputting a character from the
keyboard but the character
keyed in will not be enclosed
on the screen. i.e. the
character is invisible on the
screen.
It is included in stdio.h
Header file.
Getc() function
This function is used to
accept the character from
the file.
It is included in stdio.h
Header file.
Gets() function
This function is used to read
a string from the keyboard if
input device is not specified.
Syntax :
gets(variable_name);
E.g. char str1[50]
gets(str1);
Gets() function
When gets() function is
encountered by C compiler, it will
wait for the user to enter sequence
of character from the input device.
The wait gets automatically
terminated when an Enter key is
press.
A null character(‘0’) is
automatically assigned as a last
character of the string by the
compiler immediately after the Enter
key.
When formatted input is required :
1. When we need to input numerical
data which may required in
calculations.
2. When enter key itself is a part of
the data.
3. When we need to input data in a
particular format.
 The scanf() function is used to input
data in a formatted manner.
Scanf() Function
 The scanf() function is used to input
data in a formatted manner.
 Syntax :
 scanf(“control string”,&var1,&var2
,……………,&varn);
 In C, to represent an address of any
location , an ampersand(&) is used.
 Control string specifies the format
in which the values of variables are
to be stored.
 Each format must be preceded by %
sign .
Data Type Corresponding Character
For inputting a decimal integer %d OR %i
For inputting an unsigned positive integer %u
For inputting a character %c
For inputting a string %s
For inputting a real value without exponent form %f
For inputting a short integer %h
For inputting a long integer %ld
For inputting a double value %lf
For inputting a long double value %Lf
 C provides inbuilt function in
library stdio.h know as
printf().
 Other for them some
function name putchar() ,
putc() , puts() functions give
the output as it stored in
variable.
Putchar() Function
 The function putchar() writes a
single character , one at a time
to the standard output device.
 Syntax :
putchar(variable_name);
 When this statement is
executed , the stored character
will be displayed on the
monitor.
Putc() Function
 The function putc() send a
character to give file
instead of the standard
output device.
 Syntax :
putc(word,file);
Puts() Function
 The function puts() to write a
string to output device.
 Syntax :
puts(variable_name);
 Every string contains a null
character but puts() will not
display this character .
 C provides inbuilt function in
library stdio.h know as printf().
 Syntax :
printf(“control string” , var1 ,var2
,……,varn);
 The control string entries are
usually separated by space and
preceded by %.
Printf() Function
 The control string contains two
types object.
1. A set of characters , which will
be display on the monitor as
they come in view.
2. The format specification for
each variable in order in which
they appear.
Data Type Corresponding Character
For printing a decimal integer %d
For printing a long decimal integer %ld
For printing a signed decimal integer %i
For printing an unsigned positive integer %u
For printing an integer in octal form %o
For printing an integer in hexadecimal form %x
For printing a character %c
For printing a string %s
For printing a real value without exponent form %f
For printing a real value in exponent form %e
For printing a double value %lf
For printing a long double value %Lf

More Related Content

What's hot (20)

Input output streams
Input output streamsInput output streams
Input output streams
 
Branching statements
Branching statementsBranching statements
Branching statements
 
Files in java
Files in javaFiles in java
Files in java
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in java
 
File handling in c
File handling in cFile handling in c
File handling in c
 
C programming - String
C programming - StringC programming - String
C programming - String
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
 
File in C language
File in C languageFile in C language
File in C language
 
String functions in C
String functions in CString functions in C
String functions in C
 
String in c programming
String in c programmingString in c programming
String in c programming
 
Printf and scanf
Printf and scanfPrintf and scanf
Printf and scanf
 
Strings in C
Strings in CStrings in C
Strings in C
 
UNIT 10. Files and file handling in C
UNIT 10. Files and file handling in CUNIT 10. Files and file handling in C
UNIT 10. Files and file handling in C
 
Data types in C
Data types in CData types in C
Data types in C
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Strings
StringsStrings
Strings
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Operators in java
Operators in javaOperators in java
Operators in java
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 

Viewers also liked

Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C ProgrammingKamal Acharya
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’eShikshak
 
Input and output in c
Input and output in cInput and output in c
Input and output in cRachana Joshi
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and outputOnline
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...yazad dumasia
 
Programming embedded system_ii_keil_8051(1)
Programming embedded system_ii_keil_8051(1)Programming embedded system_ii_keil_8051(1)
Programming embedded system_ii_keil_8051(1)Fendie Mimpi
 
Automotive Circuit Boards
Automotive Circuit BoardsAutomotive Circuit Boards
Automotive Circuit BoardsArt Wood
 
C presentation book
C presentation bookC presentation book
C presentation bookkrunal1210
 
RoHS Compliant Lead Free PCB Fabrication
RoHS Compliant Lead Free PCB FabricationRoHS Compliant Lead Free PCB Fabrication
RoHS Compliant Lead Free PCB FabricationArt Wood
 
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...Art Wood
 
training_presentation
training_presentationtraining_presentation
training_presentationAniket Pawar
 
Epoxy flux a low cost high reliability approach for pop assembly-imaps 2011
Epoxy flux  a low cost high reliability approach for pop assembly-imaps 2011Epoxy flux  a low cost high reliability approach for pop assembly-imaps 2011
Epoxy flux a low cost high reliability approach for pop assembly-imaps 2011nclee715
 
New Algorithms to Improve X-Ray Inspection
New Algorithms to Improve X-Ray InspectionNew Algorithms to Improve X-Ray Inspection
New Algorithms to Improve X-Ray InspectionBill Cardoso
 
C chap02
C chap02C chap02
C chap02Kamran
 
File handling-dutt
File handling-duttFile handling-dutt
File handling-duttAnil Dutt
 

Viewers also liked (20)

Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C Programming
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Basic Input and Output
Basic Input and OutputBasic Input and Output
Basic Input and Output
 
Input and output in c
Input and output in cInput and output in c
Input and output in c
 
Managing console
Managing consoleManaging console
Managing console
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and output
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Programming embedded system_ii_keil_8051(1)
Programming embedded system_ii_keil_8051(1)Programming embedded system_ii_keil_8051(1)
Programming embedded system_ii_keil_8051(1)
 
Automotive Circuit Boards
Automotive Circuit BoardsAutomotive Circuit Boards
Automotive Circuit Boards
 
C presentation book
C presentation bookC presentation book
C presentation book
 
RoHS Compliant Lead Free PCB Fabrication
RoHS Compliant Lead Free PCB FabricationRoHS Compliant Lead Free PCB Fabrication
RoHS Compliant Lead Free PCB Fabrication
 
SMT machine Training Manual for FUJI CP6 Series Level 3
SMT machine Training Manual for FUJI  CP6 Series Level 3SMT machine Training Manual for FUJI  CP6 Series Level 3
SMT machine Training Manual for FUJI CP6 Series Level 3
 
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...
Pcb Production and Prototype Manufacturing Capabilities for Saturn Electronic...
 
Reflow oven
Reflow ovenReflow oven
Reflow oven
 
training_presentation
training_presentationtraining_presentation
training_presentation
 
Epoxy flux a low cost high reliability approach for pop assembly-imaps 2011
Epoxy flux  a low cost high reliability approach for pop assembly-imaps 2011Epoxy flux  a low cost high reliability approach for pop assembly-imaps 2011
Epoxy flux a low cost high reliability approach for pop assembly-imaps 2011
 
New Algorithms to Improve X-Ray Inspection
New Algorithms to Improve X-Ray InspectionNew Algorithms to Improve X-Ray Inspection
New Algorithms to Improve X-Ray Inspection
 
C chap02
C chap02C chap02
C chap02
 
File handling-dutt
File handling-duttFile handling-dutt
File handling-dutt
 
PIC_ARM_AVR
PIC_ARM_AVRPIC_ARM_AVR
PIC_ARM_AVR
 

Similar to Managing input and output operation in c

Console Io Operations
Console Io OperationsConsole Io Operations
Console Io Operationsarchikabhatia
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptxSKUP1
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptxLECO9
 
C programming session 08
C programming session 08C programming session 08
C programming session 08Dushmanta Nath
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streamsShahjahan Samoon
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++Haripritha
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg PatelTechNGyan
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxfaithxdunce63732
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input OutputBharat17485
 
D-38 vedant ICCPL.pptx
D-38 vedant ICCPL.pptxD-38 vedant ICCPL.pptx
D-38 vedant ICCPL.pptxVedantSahane
 
(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.pptatulchaudhary821
 
headerfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdfheaderfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdfjazzcashlimit
 
source code which create file and write into it
source code which create file and write into itsource code which create file and write into it
source code which create file and write into itmelakusisay507
 

Similar to Managing input and output operation in c (20)

Console Io Operations
Console Io OperationsConsole Io Operations
Console Io Operations
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 
Lecture 8- Data Input and Output
Lecture 8- Data Input and OutputLecture 8- Data Input and Output
Lecture 8- Data Input and Output
 
Console i/o for c++
Console i/o for c++Console i/o for c++
Console i/o for c++
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streams
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++
 
Built in function
Built in functionBuilt in function
Built in function
 
7512635.ppt
7512635.ppt7512635.ppt
7512635.ppt
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg Patel
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
 
D-38 vedant ICCPL.pptx
D-38 vedant ICCPL.pptxD-38 vedant ICCPL.pptx
D-38 vedant ICCPL.pptx
 
(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
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
 
Header files in c
Header files in cHeader files in c
Header files in c
 
headerfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdfheaderfilesinc-181121134545 (1).pdf
headerfilesinc-181121134545 (1).pdf
 
source code which create file and write into it
source code which create file and write into itsource code which create file and write into it
source code which create file and write into it
 

More from yazad dumasia

Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. yazad dumasia
 
Schemas for multidimensional databases
Schemas for multidimensional databasesSchemas for multidimensional databases
Schemas for multidimensional databasesyazad dumasia
 
Classification decision tree
Classification  decision treeClassification  decision tree
Classification decision treeyazad dumasia
 
Basic economic problem: Inflation
Basic economic problem: InflationBasic economic problem: Inflation
Basic economic problem: Inflationyazad dumasia
 
Groundwater contamination
Groundwater contaminationGroundwater contamination
Groundwater contaminationyazad dumasia
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applicationsMerge sort analysis and its real time applications
Merge sort analysis and its real time applicationsyazad dumasia
 

More from yazad dumasia (7)

Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
 
Schemas for multidimensional databases
Schemas for multidimensional databasesSchemas for multidimensional databases
Schemas for multidimensional databases
 
Classification decision tree
Classification  decision treeClassification  decision tree
Classification decision tree
 
Basic economic problem: Inflation
Basic economic problem: InflationBasic economic problem: Inflation
Basic economic problem: Inflation
 
Groundwater contamination
Groundwater contaminationGroundwater contamination
Groundwater contamination
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applicationsMerge sort analysis and its real time applications
Merge sort analysis and its real time applications
 
Cyber crime
Cyber crimeCyber crime
Cyber crime
 

Recently uploaded

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 

Recently uploaded (20)

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

Managing input and output operation in c

  • 1.
  • 2. 1. Introduction 2. Header Files 3. Unformatted input function 4. Formatted input function 5. Unformatted output function 6. Formatted output function
  • 3. Usually higher-level programs language like C,java,etc..does not have any build-in Input/Output statement as part of syntax. Therefore we use to file which has Input/Output function.
  • 4. Thus, we make header file which I/O function when it required. The value assigned for first time to any variable is called initialization. When we want to use library functions, it is required to include respective library in the program.
  • 5. The value assigned for first time to any variable is called initialization. When we want to use library functions, it is required to include respective library in the program.
  • 6. C is functional languages, so for accepting input and printing output. There must provides readymade functions. Maximum input and output are define in header files name in C is stdio.h .
  • 7. Stdio.h (standard input- output header file) included function like get(c),getchar(),gets(),printf() ,put(c),putchar,puts(),scanf(), etc.
  • 8. Other header files were 1. <ctype.h> :- Character testing and conversion function 2. <math.h> :-Mathematical function 3. <string.h> :-String manipulation
  • 9. Getchar() function  It is used to accept a character in a C program. Its standard form is Syntax : variable_name =getchar();
  • 10. Getchar() function When getchar() function will be encountered by C compiler while executing a program , the program will wait for the user to press a key from the keyboard. The character keyword in from the keyword will be enclose on the screen.
  • 11. Getche() function This function is used to take a character from consol. It is included in conio.h Header file.
  • 12. Getch() function This function is used for inputting a character from the keyboard but the character keyed in will not be enclosed on the screen. i.e. the character is invisible on the screen. It is included in stdio.h Header file.
  • 13. Getc() function This function is used to accept the character from the file. It is included in stdio.h Header file.
  • 14. Gets() function This function is used to read a string from the keyboard if input device is not specified. Syntax : gets(variable_name); E.g. char str1[50] gets(str1);
  • 15. Gets() function When gets() function is encountered by C compiler, it will wait for the user to enter sequence of character from the input device. The wait gets automatically terminated when an Enter key is press. A null character(‘0’) is automatically assigned as a last character of the string by the compiler immediately after the Enter key.
  • 16. When formatted input is required : 1. When we need to input numerical data which may required in calculations. 2. When enter key itself is a part of the data. 3. When we need to input data in a particular format.  The scanf() function is used to input data in a formatted manner.
  • 17. Scanf() Function  The scanf() function is used to input data in a formatted manner.  Syntax :  scanf(“control string”,&var1,&var2 ,……………,&varn);  In C, to represent an address of any location , an ampersand(&) is used.  Control string specifies the format in which the values of variables are to be stored.  Each format must be preceded by % sign .
  • 18. Data Type Corresponding Character For inputting a decimal integer %d OR %i For inputting an unsigned positive integer %u For inputting a character %c For inputting a string %s For inputting a real value without exponent form %f For inputting a short integer %h For inputting a long integer %ld For inputting a double value %lf For inputting a long double value %Lf
  • 19.  C provides inbuilt function in library stdio.h know as printf().  Other for them some function name putchar() , putc() , puts() functions give the output as it stored in variable.
  • 20. Putchar() Function  The function putchar() writes a single character , one at a time to the standard output device.  Syntax : putchar(variable_name);  When this statement is executed , the stored character will be displayed on the monitor.
  • 21. Putc() Function  The function putc() send a character to give file instead of the standard output device.  Syntax : putc(word,file);
  • 22. Puts() Function  The function puts() to write a string to output device.  Syntax : puts(variable_name);  Every string contains a null character but puts() will not display this character .
  • 23.  C provides inbuilt function in library stdio.h know as printf().  Syntax : printf(“control string” , var1 ,var2 ,……,varn);  The control string entries are usually separated by space and preceded by %.
  • 24. Printf() Function  The control string contains two types object. 1. A set of characters , which will be display on the monitor as they come in view. 2. The format specification for each variable in order in which they appear.
  • 25. Data Type Corresponding Character For printing a decimal integer %d For printing a long decimal integer %ld For printing a signed decimal integer %i For printing an unsigned positive integer %u For printing an integer in octal form %o For printing an integer in hexadecimal form %x For printing a character %c For printing a string %s For printing a real value without exponent form %f For printing a real value in exponent form %e For printing a double value %lf For printing a long double value %Lf