putchar() function in C Last Updated : 06 Oct, 2023 Comments Improve Suggest changes Like Article Like Report The putchar(int ch) method in C is used to write a character, of unsigned char type, to stdout. This character is passed as the parameter to this method. Syntax: int putchar(int ch) Parameters: This method accepts a mandatory parameter ch which is the character to be written to stdout. Return Value: This function returns the character written on the stdout as an unsigned char. It also returns EOF when some error occurs. The below examples illustrate the use of putchar() method: Example 1: C // C program to demonstrate putchar() method #include <stdio.h>; int main() { // Get the character to be written char ch = 'G'; // Write the Character to stdout putchar(ch); return (0); } OutputG Example 2: C // C program to demonstrate putchar() method #include <stdio.h>; int main() { // Get the character to be written char ch = '1'; // Write the Character to stdout for (ch = '1'; ch <= '9'; ch++) putchar(ch); return (0); } Output123456789 Comment More infoAdvertise with us Next Article strlen() function in c R RishabhPrabhu Follow Improve Article Tags : C Language C-Functions Similar Reads Function Pointer in C In C, a function pointer is a type of pointer that stores the address of a function, allowing functions to be passed as arguments and invoked dynamically. It is useful in techniques such as callback functions, event-driven programs, and polymorphism (a concept where a function or operator behaves di 6 min read strupr() function in c The strupr( ) function is used to converts a given string to uppercase. Syntax: char *strupr(char *str); Parameter: str: This represents the given string which we want to convert into uppercase. Returns: It returns the modified string obtained after converting the characters of the given string str 1 min read strrev() function in C The strrev() function is a built-in function in C and is defined in string.h header file. The strrev() function is used to reverse the given string. Syntax:char *strrev(char *str);Parameter:str: The given string which is needed to be reversed.Returns: This function doesn't return anything but the re 2 min read strlwr() function in C The strlwr( ) function is a built-in function in C and is used to convert a given string into lowercase. Syntax: char *strlwr(char *str); Parameter: str: This represents the given string which we want to convert into lowercase. Returns: It returns the modified string obtained after converting the ch 1 min read strlen() function in c The strlen() function in C calculates the length of a given string. The strlen() function is defined in string.h header file. It doesn't count the null character '\0'. Syntax of C strlen() The syntax of strlen() function in C is as follows: size_t strlen(const char* str);Parameters The strlen() func 1 min read C Library Function - putc() In C, the putc() function is used to write a character passed as an argument to a given stream. It is a standard library function defined in the <stdio.h> header file. The function first converts the character to unsigned char, then writes it to the given stream at the position indicated by th 4 min read Like