C Online Compiler
Example: C Program to Reverse the Case of Input Character using C Type library
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Reverse the Case of Input Character using C Type library #include <stdio.h> #include <ctype.h> // ctype.h header file loaded to call the string functions int main() { char random_char; printf("Enter an alphabet character to convert: "); scanf("%c", &random_char); printf("\nThe Reverse case of the '%c' is: '", random_char); if (islower(random_char)) putchar(toupper(random_char)); else putchar(tolower(random_char)); printf("'\n"); return 0; }
a
Output
Clear
ADVERTISEMENTS