Sunday 5 December 2010

Explain the input /output functions.

Explain the input /output functions.
A. Input output functions are divided into two types
1. Formatted functions
2. Unformated functions


Formatted functions.

2.scanf()

printf()

It is a output function is used to display the message or out put on the monitor
It is a callby value function. It is predefined in <stdio.h>.
Syntax.
printf(“control string”, variable);
printf(“message”);

For more information click on printf()

 scanf()

It is used to read the data from keyboard at run time
It is a input ()
It is predefined in <stdio.h>
Syntax.
scanf(“control string”,&var1,&var2);
scanf(“%d%d”,&a,&b);
It is a callby function.

For more information click on scanf()
scanf("%[^\n]

 Unformatted functions.
1.put char()
2.get char()
3.puts()
4.gets()

 putchar()
It is a similar to printf()
It is used to display the single character or variable on the screen
In this unformatted () are no need to use format specifiers
Ex int ch=10;
     putchar(ch);
getchar()
It is used to read a character from the keyboard and stores into the lefthand side variable.
Ex  char ch;
      ch=getchar();
puts()

It is also similar to printf()
It displays the output on the screen and curser comes to next line automatically
Ex  float d=10.56f;


No comments:

Post a Comment