The input and output can also be given with other functions in C language.The below figure shows types of C Input Output functions
Types
Alternative
forms
Output can also be given with the help of putchar(), puts() functions also.
putchar()
Description
putchar will display a single character at a time on the screen. To print many characters, then use loop statements.
Example: putchar('a');
puts()
Description
puts()will display the string followed by a new line(\n).
Example: puts(splessons)
Alternative
forms
Input can also be given using the gets() and getchar() functions.
getchar()
Description
getchar()function reads characters one by one until the return() statement is approached. To read all the characters at a time then use loops. It reads the data and stores in a variable.
Example:
int ch;
ch=getchar();
gets()
Description
gets() function reads entire line given by the user through keyboard from stdin file and assigns a null character at the end.
Example: gets(name);
Examples
[c]
#include <stdio.h>
#include <conio.h>
void main( )
{
int a;
printf("Enter a character");
a=getchar();
putchar(a);
getch();
}[/c]