
4-17
Input and Output in C
Explanation:
In the above program, no third variable is used as a mediator for swapping the values. e
below given steps illustrate the working of the program.
(i) In the rst statement, variable ‘a’ contains the sum of a+b, i.e. 11.
(ii) In the second statement, variable ‘b’ contains a-b, i.e. 11−4 =7.
(iii) In the third statement, variable ‘a’ contains a-b, i.e. 11−7=4.
us, the two values are interchanged.
4.3 UNFORMATTED FUNCTIONS
C has three types of I/O functions.
(i) Character I/O
(ii) String I/O
(iii) File I/O
(i) Character I/O
1.
getchar() -
is function reads a character-type data from standard in ...