Predefined streams :
following are the streams....
- stdin( )
- stdout( )
- stderr( )
- stdin : The file pointer stdin identifies the standard input text and it is associated with our terminal.All standard input and output functions perform input and do not take a FILE pointer as an argument and get their input from stdin.
- stdout : Similarly,it is used for outputting the text .It is a standard output stream.
- stderr : It is an output stream in the text mode. It is a standard error stream.
#include<stdio.h>
main( )
{
char ch[11];
int i;
printf("input a text");
for(i=0;i<10;i++)
ch[i]=getc(stdin);
printf("The text inputted was");
for(i=0;i<10;i++)
putc(ch[i],stdout);
}
OUTPUT:
input a text : Hello world
The text entered was
Hello world
Explanation :
In the above program two for loops are used.The first for loop reads input character from the keyboard and stores in an array ch [11] by using stdin standard function.The second for loop display the string using stdout standard function.