SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
Input output statement
C
S.Muthuganesh M.Sc.,B.Ed
scanf
• Usually input statement is used in C is scanf()
Syntax
• scanf (“control string”, &v1,&v2,&v3,…&vn);
• The control string must be a text enclosed in double quotes.
• It contains the data format of data being received.
• The ampersand & before each variable is an operator that specified the variable’s
names address and connecting it into internal representation in memory.
• Example for control string : integer (%d) , float (%f) , character (%c) or string (%s).
Printf()
•printf() function is used to print the “character, string, float, integer, octal and
hexadecimal values” onto the output screen.
•We use printf() function with %d , %f, %s forrmat specifier to display the value of
an variable.
•To generate a newline,we use “n” in printf() statement.
Syntax
printf (“outputstring identifiers(like %s,%d)”, variablenames);
Example
• printf(“hai hello%s”,name);
getchar()
• getchar is a function in C programming language that reads a single character.
getchar() function is used to get/read a character from keyboard input. When this
statement encountered the computer waits until key is pressed.
Syntax
Variable_name=getchar();
• Example
char name;
name = getchar();
putchar()
• putchar() function in C programming language which is used to write a character
on standard output/screen.
Syntax
putchar(variablename);
• Example
Choice=’y’;
putchar(Choice);
Thank you

More Related Content

PDF
Lightning web components - Episode 1 - An Introduction
PPTX
Rolls royce
PDF
A brief Intro to Digital Forensics
PPTX
PRESENTATION ON COMPUTER SYSTEM
PDF
Operators in c programming
PPT
Operators in C Programming
PPTX
Encase Forensic
PDF
Data structure ppt
Lightning web components - Episode 1 - An Introduction
Rolls royce
A brief Intro to Digital Forensics
PRESENTATION ON COMPUTER SYSTEM
Operators in c programming
Operators in C Programming
Encase Forensic
Data structure ppt

What's hot (20)

PPT
Strings
PPTX
PPTX
String C Programming
PPTX
Strings in c++
PPTX
Array Of Pointers
PPTX
Pointer in C++
PPTX
Constant, variables, data types
PPTX
Control statements in c
PPTX
Unit 3. Input and Output
PPTX
Strings in C language
PPT
Constants in C Programming
PPTX
C programming - String
PDF
Object oriented programming c++
PPTX
String in c programming
PPTX
Looping statements in C
PPT
RECURSION IN C
PPTX
PPTX
Python strings presentation
PPTX
Unit 2. Elements of C
PPTX
C++ decision making
Strings
String C Programming
Strings in c++
Array Of Pointers
Pointer in C++
Constant, variables, data types
Control statements in c
Unit 3. Input and Output
Strings in C language
Constants in C Programming
C programming - String
Object oriented programming c++
String in c programming
Looping statements in C
RECURSION IN C
Python strings presentation
Unit 2. Elements of C
C++ decision making
Ad

Similar to Input output statement in C (20)

PPTX
CHAPTER 4
PDF
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
PPTX
Basic Input and Output
PPT
Mesics lecture 5 input – output in ‘c’
PPT
Mesics lecture 5 input – output in ‘c’
PPTX
Lecture-2.pptxefygefyeyyegfygcyewvwvvcvywcy
PPTX
Introduction to Basic C programming 02
PPTX
Unit 2- Module 2.pptx
PPT
Input And Output
PPT
scanf function in c, variations in conversion specifier
PPT
Fundamental of C Programming Language and Basic Input/Output Function
PPT
input
PPTX
Input and Output In C Language
PPSX
Concepts of C [Module 2]
PDF
2 3. standard io
PPT
CPU INPUT OUTPUT
PPT
Fucntions & Pointers in C
PPTX
C language
PPTX
Introduction to C Programming
DOCX
string , pointer
CHAPTER 4
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
Basic Input and Output
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
Lecture-2.pptxefygefyeyyegfygcyewvwvvcvywcy
Introduction to Basic C programming 02
Unit 2- Module 2.pptx
Input And Output
scanf function in c, variations in conversion specifier
Fundamental of C Programming Language and Basic Input/Output Function
input
Input and Output In C Language
Concepts of C [Module 2]
2 3. standard io
CPU INPUT OUTPUT
Fucntions & Pointers in C
C language
Introduction to C Programming
string , pointer
Ad

More from Muthuganesh S (12)

PPTX
javascript.pptx
PPTX
Operation Research VS Software Engineering
DOC
PPTX
PPTX
Conditional statement in c
PDF
Php notes
PPTX
Php Basics Iterations, looping
PPTX
PHP Basics
PPTX
PPTX
Introduction to c
PPTX
Javascript dom
javascript.pptx
Operation Research VS Software Engineering
Conditional statement in c
Php notes
Php Basics Iterations, looping
PHP Basics
Introduction to c
Javascript dom

Recently uploaded (20)

PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Classroom Observation Tools for Teachers
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
human mycosis Human fungal infections are called human mycosis..pptx
Pharma ospi slides which help in ospi learning
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Computing-Curriculum for Schools in Ghana
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Microbial disease of the cardiovascular and lymphatic systems
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Final Presentation General Medicine 03-08-2024.pptx
A systematic review of self-coping strategies used by university students to ...
2.FourierTransform-ShortQuestionswithAnswers.pdf
RMMM.pdf make it easy to upload and study
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Classroom Observation Tools for Teachers
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Orientation - ARALprogram of Deped to the Parents.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf

Input output statement in C

  • 2. scanf • Usually input statement is used in C is scanf() Syntax • scanf (“control string”, &v1,&v2,&v3,…&vn); • The control string must be a text enclosed in double quotes. • It contains the data format of data being received. • The ampersand & before each variable is an operator that specified the variable’s names address and connecting it into internal representation in memory. • Example for control string : integer (%d) , float (%f) , character (%c) or string (%s).
  • 3. Printf() •printf() function is used to print the “character, string, float, integer, octal and hexadecimal values” onto the output screen. •We use printf() function with %d , %f, %s forrmat specifier to display the value of an variable. •To generate a newline,we use “n” in printf() statement. Syntax printf (“outputstring identifiers(like %s,%d)”, variablenames); Example • printf(“hai hello%s”,name);
  • 4. getchar() • getchar is a function in C programming language that reads a single character. getchar() function is used to get/read a character from keyboard input. When this statement encountered the computer waits until key is pressed. Syntax Variable_name=getchar(); • Example char name; name = getchar();
  • 5. putchar() • putchar() function in C programming language which is used to write a character on standard output/screen. Syntax putchar(variablename); • Example Choice=’y’; putchar(Choice);