SlideShare a Scribd company logo
4
Most read
5
Most read
9
Most read
“
”
Managing input and output
operations in c
CREATED BY NIYAMATH
INDEX
INTRODUCTION
UNFORMATED INPUT AND OUTPUT FUNCTION
FORMATTED INPUT
FORMATTED OUTPUT
 SOFTWARE ENGINEERING
TIPES
INTRODUCTION
 C Does not contain any build in function in input and output function.
 C carrys input and output operations in library function like printf() and scanf().
 In standared I/O operations include header file called stdio.h
 C program using must begin with the statement
FUNCTIONS
1. Scanf( )
2. Printf( )
3. Getchar( )
4. Putchar( )
5. Gets( )
6. Puts( )
This all functions are transfers data between computers and standard I/O devices
like monitors and keyboard
UNFORMETTED I/O FUNCTIONS
 Getchar( ):-
It is used to accept a single character using library function in a c program
syntax:- variable_name=getchar( );
 Putchar( ):-
single characters can be displayed using the library function putchar( ).
syntax:- putchar(variable_name);
 Gets( ):-
This function is used to read a string from the keyboard if input device is not specified.
syntax:- gets(string);
 Puts( ):-
It is used to print sting type of data.it also takes single arguments.
syntax:- puts(expression);
FORMATTED TNPUT with (scanf( ))
 The scanf() function is used to input data in a formatted manner.
syntax:- scanf(“control string”,list of address of variables);
or
scanf(“control sting”,&var1,&var2,…………….,&varn);
 In c to represent an address of any location an ampersand(&)is used.
 Scanf() ignores all leading spaces,blanks,tabs,newlines etc.
 Scanf() can also used to read a sting of characters.
FORMAT OF DATA TYPE CHARACTER IN
SCANF( ).
DATA TYPE
INTEGER integer
short
short unsigned
long
long assigned
hexadecimal
long hexa
octal
REAL float,double
CHARACTER
STING
FORMAT
%d
%d
%u
%id
%iu
%x
%ix
%o(letter 0)
%f,%if,%g
%c
%s
FORMATTED OUTPUT WITH (printf( )).
 C provides inbuilt function in library stdio.h known as printf( )
 The printf() moves data from computers memory to standard output device
syntax:- printf(“control string”,var1,var2,………,var n);
 The control sting entries are usually separated by spaces and precedence.
FORMAT OF DATA TYPE CONVERSION IN
PRINTF( ).
DATA TYPE
INTEGER integer
short
short unsigned
long
long assigned
hexa
long hexa
octal
long octal
REAL float
double
Character
string
FORMAT
%d
%d
%u
%id
%iu
%x
%ix
%o(letter 0)
%io
%f,%g
%if,%e,%e
%c
%s
PRINTING INTEGERS
 PRINTING INTEGER:-
An integer is a whole number ,when field width specified is greater
than the number,leading blanks are included.
when the field width is not specified or when the width is less than
the number to be printed.
%wd right justifies the output
%-wd left justifies the output
%0wd right justifies the output
FORMAT
PRINTING A SINGLE CHARACTER
 Single characters can be printed in the required position by using the format.
 %wc gives right justified output
%-wc gives left justified output
ex:-
char ch=‘A’
printf(“%5c%c”,ch,ch);
output:-
A A
%c or %wc
PRINTNG STRING
 Stings are generally printed using the format
%ws leads to left justified output
%-ws leads to right justified output
 Escape sequence (tab space) can be used to insert space between outputs.
%s or %ws
Printf(“%s”,name);
Printf(“%10s”,name);
Printf(“%20s”,name);
Printf(“-20”,name);
SOFTWARE ENGINEERING
1) Program documentation has 2 levels are:-
a) General documentation:-
it starts at the beginning of any program containing the following
commet statements:
1. name.
2. Name of auther.
3. Data of first version written
b) Modular documentation:-
it consists of brief description using comments for every block
code.each block code must be separated by a blank line.
2) Data names:-
1. Dataname must be as close as possible to the general terminology used.
2. Dataname must not be too short or abbreviated so much that they lose their
identity.
3. In long datanames the first letter of each word can be capitalized such as ProductID
4. Do not create datanames that are too similar especially when there Is difference of only
one or two letters.
5. try to avoid using generic datanames such as sum,total,emp etc.

More Related Content

What's hot (20)

PPTX
Storage classes in c language
tanmaymodi4
 
PPT
CPU INPUT OUTPUT
Aditya Vaishampayan
 
PPTX
Unit 6. Arrays
Ashim Lamichhane
 
PPTX
Strings in C language
P M Patil
 
PPT
File handling in c
David Livingston J
 
PDF
Structures in c++
Swarup Kumar Boro
 
PPTX
File Management in C
Paurav Shah
 
PPTX
Error managing and exception handling in java
Andhra University
 
PPTX
C functions
University of Potsdam
 
PPTX
Strings in C
Kamal Acharya
 
PDF
C standard library functions
Vaishnavee Sharma
 
PPTX
Operators and expressions in c language
tanmaymodi4
 
PPT
Constants in C Programming
programming9
 
PPTX
File in C language
Manash Kumar Mondal
 
PDF
Character Array and String
Tasnima Hamid
 
PPTX
Printf and scanf
gidc engineering college
 
PPTX
Function in C program
Nurul Zakiah Zamri Tan
 
Storage classes in c language
tanmaymodi4
 
CPU INPUT OUTPUT
Aditya Vaishampayan
 
Unit 6. Arrays
Ashim Lamichhane
 
Strings in C language
P M Patil
 
File handling in c
David Livingston J
 
Structures in c++
Swarup Kumar Boro
 
File Management in C
Paurav Shah
 
Error managing and exception handling in java
Andhra University
 
Strings in C
Kamal Acharya
 
C standard library functions
Vaishnavee Sharma
 
Operators and expressions in c language
tanmaymodi4
 
Constants in C Programming
programming9
 
File in C language
Manash Kumar Mondal
 
Character Array and String
Tasnima Hamid
 
Printf and scanf
gidc engineering college
 
Function in C program
Nurul Zakiah Zamri Tan
 

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

PDF
Introduction to Input/Output Functions in C
Thesis Scientist Private Limited
 
PPSX
Concepts of C [Module 2]
Abhishek Sinha
 
PPT
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
PPT
Input And Output
Ghaffar Khan
 
PPTX
Functions of stdio conio
Bhavik Vashi
 
PPTX
Input and Output In C Language
Adnan Khan
 
PPTX
Data Input and Output
Sabik T S
 
DOCX
UNIT-II CP DOC.docx
JavvajiVenkat
 
PPTX
Lecture-2.pptxefygefyeyyegfygcyewvwvvcvywcy
hamzah7958
 
PPTX
I o functions
Dr.Sandhiya Ravi
 
PDF
3_Input_output.pdf this is about orogramminy
sumiyaahmedachol
 
PPT
Lecture 8- Data Input and Output
Md. Imran Hossain Showrov
 
PPTX
Basic Input and Output
Nurul Zakiah Zamri Tan
 
PPTX
CHAPTER 4
mohd_mizan
 
PDF
CP Handout#2
trupti1976
 
PPTX
Input Output function in c programing language.pptx
amit0815q
 
PPT
Unit1 C
arnold 7490
 
PPT
Unit1 C
arnold 7490
 
PPTX
20220823094225_PPT02-Formatted Input and Output.pptx
putrielisabeth3
 
PDF
Cse115 lecture04introtoc programming
Md. Ashikur Rahman
 
Introduction to Input/Output Functions in C
Thesis Scientist Private Limited
 
Concepts of C [Module 2]
Abhishek Sinha
 
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
Input And Output
Ghaffar Khan
 
Functions of stdio conio
Bhavik Vashi
 
Input and Output In C Language
Adnan Khan
 
Data Input and Output
Sabik T S
 
UNIT-II CP DOC.docx
JavvajiVenkat
 
Lecture-2.pptxefygefyeyyegfygcyewvwvvcvywcy
hamzah7958
 
I o functions
Dr.Sandhiya Ravi
 
3_Input_output.pdf this is about orogramminy
sumiyaahmedachol
 
Lecture 8- Data Input and Output
Md. Imran Hossain Showrov
 
Basic Input and Output
Nurul Zakiah Zamri Tan
 
CHAPTER 4
mohd_mizan
 
CP Handout#2
trupti1976
 
Input Output function in c programing language.pptx
amit0815q
 
Unit1 C
arnold 7490
 
Unit1 C
arnold 7490
 
20220823094225_PPT02-Formatted Input and Output.pptx
putrielisabeth3
 
Cse115 lecture04introtoc programming
Md. Ashikur Rahman
 
Ad

Recently uploaded (20)

PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Dimensions of Societal Planning in Commonism
StefanMz
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Ad

Managing input and output operations in c

  • 1. “ ” Managing input and output operations in c CREATED BY NIYAMATH
  • 2. INDEX INTRODUCTION UNFORMATED INPUT AND OUTPUT FUNCTION FORMATTED INPUT FORMATTED OUTPUT  SOFTWARE ENGINEERING TIPES
  • 3. INTRODUCTION  C Does not contain any build in function in input and output function.  C carrys input and output operations in library function like printf() and scanf().  In standared I/O operations include header file called stdio.h  C program using must begin with the statement
  • 4. FUNCTIONS 1. Scanf( ) 2. Printf( ) 3. Getchar( ) 4. Putchar( ) 5. Gets( ) 6. Puts( ) This all functions are transfers data between computers and standard I/O devices like monitors and keyboard
  • 5. UNFORMETTED I/O FUNCTIONS  Getchar( ):- It is used to accept a single character using library function in a c program syntax:- variable_name=getchar( );  Putchar( ):- single characters can be displayed using the library function putchar( ). syntax:- putchar(variable_name);  Gets( ):- This function is used to read a string from the keyboard if input device is not specified. syntax:- gets(string);
  • 6.  Puts( ):- It is used to print sting type of data.it also takes single arguments. syntax:- puts(expression);
  • 7. FORMATTED TNPUT with (scanf( ))  The scanf() function is used to input data in a formatted manner. syntax:- scanf(“control string”,list of address of variables); or scanf(“control sting”,&var1,&var2,…………….,&varn);  In c to represent an address of any location an ampersand(&)is used.  Scanf() ignores all leading spaces,blanks,tabs,newlines etc.  Scanf() can also used to read a sting of characters.
  • 8. FORMAT OF DATA TYPE CHARACTER IN SCANF( ). DATA TYPE INTEGER integer short short unsigned long long assigned hexadecimal long hexa octal REAL float,double CHARACTER STING FORMAT %d %d %u %id %iu %x %ix %o(letter 0) %f,%if,%g %c %s
  • 9. FORMATTED OUTPUT WITH (printf( )).  C provides inbuilt function in library stdio.h known as printf( )  The printf() moves data from computers memory to standard output device syntax:- printf(“control string”,var1,var2,………,var n);  The control sting entries are usually separated by spaces and precedence.
  • 10. FORMAT OF DATA TYPE CONVERSION IN PRINTF( ). DATA TYPE INTEGER integer short short unsigned long long assigned hexa long hexa octal long octal REAL float double Character string FORMAT %d %d %u %id %iu %x %ix %o(letter 0) %io %f,%g %if,%e,%e %c %s
  • 11. PRINTING INTEGERS  PRINTING INTEGER:- An integer is a whole number ,when field width specified is greater than the number,leading blanks are included. when the field width is not specified or when the width is less than the number to be printed. %wd right justifies the output %-wd left justifies the output %0wd right justifies the output
  • 13. PRINTING A SINGLE CHARACTER  Single characters can be printed in the required position by using the format.  %wc gives right justified output %-wc gives left justified output ex:- char ch=‘A’ printf(“%5c%c”,ch,ch); output:- A A %c or %wc
  • 14. PRINTNG STRING  Stings are generally printed using the format %ws leads to left justified output %-ws leads to right justified output  Escape sequence (tab space) can be used to insert space between outputs. %s or %ws Printf(“%s”,name); Printf(“%10s”,name); Printf(“%20s”,name); Printf(“-20”,name);
  • 15. SOFTWARE ENGINEERING 1) Program documentation has 2 levels are:- a) General documentation:- it starts at the beginning of any program containing the following commet statements: 1. name. 2. Name of auther. 3. Data of first version written b) Modular documentation:- it consists of brief description using comments for every block code.each block code must be separated by a blank line.
  • 16. 2) Data names:- 1. Dataname must be as close as possible to the general terminology used. 2. Dataname must not be too short or abbreviated so much that they lose their identity. 3. In long datanames the first letter of each word can be capitalized such as ProductID 4. Do not create datanames that are too similar especially when there Is difference of only one or two letters. 5. try to avoid using generic datanames such as sum,total,emp etc.