SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
INPUT OUTPUT STATEMENT
PROF. SUNIL D. CHUTE
HEAD DEPT OF COMPUTER SCIENCE
M. G. COLLEGE ARMORI
C Input and Output
 Input means to provide the program with some data to be used in the
program and
 Output means to display data on screen or write the data to a printer or a
file.
C programming language provides many built-in functions to read any
given input and to display data on screen when there is a need to output the
result.
scanf() and printf() functions
 The standard input-output header file,
named stdio.h contains the definition of the
functions printf() and scanf(), which are used to display
output on screen and to take input from user respectively.
#include<stdio.h>
void main()
{
// defining a variable
int i;
/*
displaying message on the screen
asking the user to input a value
*/
printf("Please enter a value...");
/*
reading the value entered by the user
*/
scanf("%d", &i);
/*
 You must be wondering what is the purpose
of %d inside the scanf() or printf() functions. It
is known as format string and this informs
the scanf() function, what type of input to
expect and in printf() it is used to give a heads
up to the compiler, what type of output to
expect.
Format String Meaning
%d Scan or print an integer as signed
decimal number
%f Scan or print a floating point number
%c To scan or print a character
%s To scan or print a character string.
The scanning ends at whitespace.
Input output statement
Input output statement
Input output statement
Input output statement
Input output statement
Input output statement
Input output statement
Input output statement
Ad

Recommended

PPTX
Functions in C
Kamal Acharya
 
PPTX
Presentation on Function in C Programming
Shuvongkor Barman
 
PPTX
Presentation on c structures
topu93
 
PDF
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
 
PPTX
Java Tokens
Madishetty Prathibha
 
PPTX
Object oriented programming in python
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
How to download and install Python - lesson 2
Shohel Rana
 
PPTX
C Programming Unit-5
Vikram Nandini
 
PPTX
Functions in C
Shobhit Upadhyay
 
PDF
Function in C
Dr. Abhineet Anand
 
PPTX
Variables in python
Jaya Kumari
 
PPTX
Identifiers
Then Murugeshwari
 
PPTX
Operator overloading
Burhan Ahmed
 
PPTX
inline function
imran khan
 
PPTX
User defined functions in C
Harendra Singh
 
PPTX
Exception Handling in Java
lalithambiga kamaraj
 
PPTX
Parameter passing to_functions_in_c
ForwardBlog Enewzletter
 
PPTX
Command line arguments
Ashok Raj
 
PPT
358 33 powerpoint-slides_2-functions_chapter-2
sumitbardhan
 
PPTX
Data types in C language
kashyap399
 
PPTX
classes and objects in C++
HalaiHansaika
 
PDF
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
PPTX
This pointer
Kamal Acharya
 
PPTX
File handling in Python
Megha V
 
PPTX
Function C programming
Appili Vamsi Krishna
 
PPTX
Characteristics of OOPS
abhishek kumar
 
PPTX
File in C language
Manash Kumar Mondal
 
PPTX
Type Conversion, Precedence and Associativity
Aakash Singh
 
PDF
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
PPTX
1_Introduction of programming language C.pptx
b221382
 

More Related Content

What's hot (20)

PPTX
Functions in C
Shobhit Upadhyay
 
PDF
Function in C
Dr. Abhineet Anand
 
PPTX
Variables in python
Jaya Kumari
 
PPTX
Identifiers
Then Murugeshwari
 
PPTX
Operator overloading
Burhan Ahmed
 
PPTX
inline function
imran khan
 
PPTX
User defined functions in C
Harendra Singh
 
PPTX
Exception Handling in Java
lalithambiga kamaraj
 
PPTX
Parameter passing to_functions_in_c
ForwardBlog Enewzletter
 
PPTX
Command line arguments
Ashok Raj
 
PPT
358 33 powerpoint-slides_2-functions_chapter-2
sumitbardhan
 
PPTX
Data types in C language
kashyap399
 
PPTX
classes and objects in C++
HalaiHansaika
 
PDF
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
PPTX
This pointer
Kamal Acharya
 
PPTX
File handling in Python
Megha V
 
PPTX
Function C programming
Appili Vamsi Krishna
 
PPTX
Characteristics of OOPS
abhishek kumar
 
PPTX
File in C language
Manash Kumar Mondal
 
PPTX
Type Conversion, Precedence and Associativity
Aakash Singh
 
Functions in C
Shobhit Upadhyay
 
Function in C
Dr. Abhineet Anand
 
Variables in python
Jaya Kumari
 
Identifiers
Then Murugeshwari
 
Operator overloading
Burhan Ahmed
 
inline function
imran khan
 
User defined functions in C
Harendra Singh
 
Exception Handling in Java
lalithambiga kamaraj
 
Parameter passing to_functions_in_c
ForwardBlog Enewzletter
 
Command line arguments
Ashok Raj
 
358 33 powerpoint-slides_2-functions_chapter-2
sumitbardhan
 
Data types in C language
kashyap399
 
classes and objects in C++
HalaiHansaika
 
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
This pointer
Kamal Acharya
 
File handling in Python
Megha V
 
Function C programming
Appili Vamsi Krishna
 
Characteristics of OOPS
abhishek kumar
 
File in C language
Manash Kumar Mondal
 
Type Conversion, Precedence and Associativity
Aakash Singh
 

Similar to Input output statement (20)

PDF
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
PPTX
1_Introduction of programming language C.pptx
b221382
 
PPTX
Input output in c
Ducat
 
PPTX
Input and Output In C Language
Adnan Khan
 
PDF
CP Handout#2
trupti1976
 
PPTX
Sachin kumar ppt on programming in c
Sachin Kumar
 
PPTX
Programming Fundamentals lecture 5
REHAN IJAZ
 
PPTX
C basics
thirumalaikumar3
 
DOCX
UNIT-II CP DOC.docx
JavvajiVenkat
 
PPT
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
PPTX
Theory of programming
tcc_joemarie
 
PPTX
Building Simple C Program
JeraldPastorCejas
 
PPTX
Data Input and Output
Sabik T S
 
PPTX
Introduction to C Unit 1
Dr. SURBHI SAROHA
 
PPTX
C Language Programming Introduction Lecture
myinstalab
 
PPTX
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
PDF
First c program
Komal Pardeshi
 
PPTX
COM1407: Input/ Output Functions
Hemantha Kulathilake
 
PDF
C taking user input
ArghodeepPaul
 
DOCX
Programming in c
Ashutosh Srivasatava
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
1_Introduction of programming language C.pptx
b221382
 
Input output in c
Ducat
 
Input and Output In C Language
Adnan Khan
 
CP Handout#2
trupti1976
 
Sachin kumar ppt on programming in c
Sachin Kumar
 
Programming Fundamentals lecture 5
REHAN IJAZ
 
UNIT-II CP DOC.docx
JavvajiVenkat
 
Fundamental of C Programming Language and Basic Input/Output Function
imtiazalijoono
 
Theory of programming
tcc_joemarie
 
Building Simple C Program
JeraldPastorCejas
 
Data Input and Output
Sabik T S
 
Introduction to C Unit 1
Dr. SURBHI SAROHA
 
C Language Programming Introduction Lecture
myinstalab
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
First c program
Komal Pardeshi
 
COM1407: Input/ Output Functions
Hemantha Kulathilake
 
C taking user input
ArghodeepPaul
 
Programming in c
Ashutosh Srivasatava
 
Ad

More from sunilchute1 (10)

PPTX
Programming construction tools
sunilchute1
 
PPTX
Introduction to data structure
sunilchute1
 
PPTX
Sorting method data structure
sunilchute1
 
PPTX
Introduction to data structure
sunilchute1
 
PPTX
Basic data types in python
sunilchute1
 
PPTX
Call by value and call by reference in java
sunilchute1
 
PPTX
Java method
sunilchute1
 
PPTX
Constructors in java
sunilchute1
 
PPTX
C loops
sunilchute1
 
PPT
Basic of c language
sunilchute1
 
Programming construction tools
sunilchute1
 
Introduction to data structure
sunilchute1
 
Sorting method data structure
sunilchute1
 
Introduction to data structure
sunilchute1
 
Basic data types in python
sunilchute1
 
Call by value and call by reference in java
sunilchute1
 
Java method
sunilchute1
 
Constructors in java
sunilchute1
 
C loops
sunilchute1
 
Basic of c language
sunilchute1
 
Ad

Recently uploaded (20)

PDF
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
PDF
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
PPTX
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
PPTX
Great Governors' Send-Off Quiz 2025 Prelims IIT KGP
IIT Kharagpur Quiz Club
 
PPTX
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
PDF
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
PPTX
Photo chemistry Power Point Presentation
mprpgcwa2024
 
PPTX
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
PPTX
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
PPTX
How to use _name_search() method in Odoo 18
Celine George
 
PPTX
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
PDF
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
PPTX
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
PPTX
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
PPTX
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
PPTX
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
PDF
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
PDF
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
LAZY SUNDAY QUIZ "A GENERAL QUIZ" JUNE 2025 SMC QUIZ CLUB, SILCHAR MEDICAL CO...
Ultimatewinner0342
 
Great Governors' Send-Off Quiz 2025 Prelims IIT KGP
IIT Kharagpur Quiz Club
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Photo chemistry Power Point Presentation
mprpgcwa2024
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
How to use _name_search() method in Odoo 18
Celine George
 
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
Code Profiling in Odoo 18 - Odoo 18 Slides
Celine George
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
IIT KGP Quiz Week 2024 Sports Quiz (Prelims + Finals)
IIT Kharagpur Quiz Club
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 

Input output statement

  • 1. INPUT OUTPUT STATEMENT PROF. SUNIL D. CHUTE HEAD DEPT OF COMPUTER SCIENCE M. G. COLLEGE ARMORI
  • 2. C Input and Output  Input means to provide the program with some data to be used in the program and  Output means to display data on screen or write the data to a printer or a file. C programming language provides many built-in functions to read any given input and to display data on screen when there is a need to output the result.
  • 3. scanf() and printf() functions  The standard input-output header file, named stdio.h contains the definition of the functions printf() and scanf(), which are used to display output on screen and to take input from user respectively. #include<stdio.h> void main() { // defining a variable int i; /* displaying message on the screen asking the user to input a value */ printf("Please enter a value..."); /* reading the value entered by the user */ scanf("%d", &i); /*
  • 4.  You must be wondering what is the purpose of %d inside the scanf() or printf() functions. It is known as format string and this informs the scanf() function, what type of input to expect and in printf() it is used to give a heads up to the compiler, what type of output to expect. Format String Meaning %d Scan or print an integer as signed decimal number %f Scan or print a floating point number %c To scan or print a character %s To scan or print a character string. The scanning ends at whitespace.