Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Returned values of Printf, Scanf and other functions in C

Published on 07 Mar 2020

printf() - printf() returns the number of characters successfully written on the output. It is used to simply print data in the output.


scanf() - It returns the number of data items that have been entered successfully. It is used to read input data (simile characters, numerical values, and strings) entered into the computer from a standard input device.


getchar() -Reads a character from the standard input device. The return type of this function is int.


putchar() - Sends a character to the standard output device.


getc()- It reads a single character from a given input stream and returns the corresponding integer value


Example:

int main()
{
  printf(" %d", printf("%s", "this is codelab"));
  getchar();
}  

 
int main()
{
  char a[50];  
  printf(" %d", scanf("%s", a));
  getchar();
}  
If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in