Input Output Function in C by Sulav Acharya

AchSulav 3 views 30 slides Apr 27, 2024
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also ...


Slide Content

- - --::::-..










D So, we need some methods that can
read input and w rite output on a
suitable input/output medium.
D Most
input
programs take some data as
and display the processed data
or result as output.
D Reading, processing and w riting of
data are three essentia l functions of a
computer program.

----------
-- .. -.--













conta ins a n a lpha bet; other w ise it
a ssume s O (FA LSE) . Simila r for
isdigit function.
zero(TRUE) if the argument character
D isalpha function assumes a value non­

-----= -----_------




-- -- -




D w here va riable_ na me is a ty pe cha
r va riable conta ining a cha racter.
This sta tement displa y s
the cha racter conta ined
in the
va riable na me at the termina l.

0
/o, a data type character(or type









D The field (or forma t) specifica
tions, consisti ng of the conv
ersion cha racter





specifier), a nd a n optiona l
number, specify ing the field w
idth.

0

I nputtingI nteger Numbers
D The field specification for reading an
integer number is:
/ow d
D w is an integer number that specifies
the field w idth of the number to be
read and d, known as data type
character.

------

D On the other way if we have written _: ·-
- - --
Scanf("0/od0/od",&num1,&num2);
W ill read the data 31426 50
Correctly in num1, num2.
D Input data items must be separated by
spaces,tabs or new lines.
D When the scanf reads a particular value,
reading of the value will terminate as soon
as the number of characters specified by
the field width is reached(if specified) or
until a character that is not valid for the
value being read is encountered.

0 0 0
0

D An input field may be skipped by specifying
* in the place of field width.
For example,




Scant ( /od /o*d /od",&a,&b);




Input: 123 456
789

123

4 56

789

a skipped b
The data character d may be preceded
by 'I' to read long integers. ( /o ld)

0 0
0





- - - - - -





DThe specifica tions f or reading cha
racter strings a re :
/ow s or /ow c
0° / o w c used to read a single
cha racter w hile /ow s
termina tes the reading at the
encounter of bla nk spa ce.
Tags