B.Bhuvaneswaran, AP (SG) / CSE
9791519152
bhuvaneswaran@rajalakshmi.edu.in
Programming Logic
Managing I/P
and O/P
Operations
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 2
Rajalakshmi Engineering College 2
Introduction
 The important aspect of C programming language is its ability to
handle input and output.
 Even though C does not have the language construct for I/O
operations, a set of functions designed to provide a standard I/O
system for C programs has been defined such as printf(), scanf(),
puthchar() and getchar() functions.
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 3
Rajalakshmi Engineering College 3
Introduction
 A program using these functions must include the standard
header file stdio.h in it, using the directive statement at the
beginning as:
#include <stdio.h>
 The filename stdio.h is an abbreviation for "standard input-output
header file".
 The instruction #include <stdio.h> tells the compiler to search for
a file named stdio.h and place its contents at this point in the
program.
 The contents of the header file become part of the source code
when it is compiled.
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 4
Rajalakshmi Engineering College 4
Types of Input / Output Functions
 Unformatted I/O functions
 Formatted I/O functions
I/O Functions
Unformatted
I/O Functions
Formatted
I/O Functions
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 5
Rajalakshmi Engineering College 5
Unformatted I/O Functions
Unformatted
I/O Functions
Unformatted
Input Functions
getchar() getch() getche() gets()
Unformatted
Output Functions
putchar() putch() puts()
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 6
Rajalakshmi Engineering College 6
Formatted I/O Functions
Formatted
I/O Functions
Formatted
Input
Functions
scanf() fscanf()
Formatted
Output
Functions
printf() fprintf()
Managing Input and Output Operations
Managing Input and Output Operations Rajalakshmi Engineering College 7
Rajalakshmi Engineering College 7
Input / Output Devices
 Standard input device  Keyboard
 Standard output device  Screen (Monitor / VDU)
Thank You

C Programming-Lecture Notes-07-Managing Input and Output Operations.pdf

  • 1.
    B.Bhuvaneswaran, AP (SG)/ CSE 9791519152 bhuvaneswaran@rajalakshmi.edu.in Programming Logic Managing I/P and O/P Operations
  • 2.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 2 Rajalakshmi Engineering College 2 Introduction  The important aspect of C programming language is its ability to handle input and output.  Even though C does not have the language construct for I/O operations, a set of functions designed to provide a standard I/O system for C programs has been defined such as printf(), scanf(), puthchar() and getchar() functions.
  • 3.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 3 Rajalakshmi Engineering College 3 Introduction  A program using these functions must include the standard header file stdio.h in it, using the directive statement at the beginning as: #include <stdio.h>  The filename stdio.h is an abbreviation for "standard input-output header file".  The instruction #include <stdio.h> tells the compiler to search for a file named stdio.h and place its contents at this point in the program.  The contents of the header file become part of the source code when it is compiled.
  • 4.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 4 Rajalakshmi Engineering College 4 Types of Input / Output Functions  Unformatted I/O functions  Formatted I/O functions I/O Functions Unformatted I/O Functions Formatted I/O Functions
  • 5.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 5 Rajalakshmi Engineering College 5 Unformatted I/O Functions Unformatted I/O Functions Unformatted Input Functions getchar() getch() getche() gets() Unformatted Output Functions putchar() putch() puts()
  • 6.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 6 Rajalakshmi Engineering College 6 Formatted I/O Functions Formatted I/O Functions Formatted Input Functions scanf() fscanf() Formatted Output Functions printf() fprintf()
  • 7.
    Managing Input andOutput Operations Managing Input and Output Operations Rajalakshmi Engineering College 7 Rajalakshmi Engineering College 7 Input / Output Devices  Standard input device  Keyboard  Standard output device  Screen (Monitor / VDU)
  • 8.