C Tutorial
This c program uses toupper and tolower predefined function from ctype header to return the corresponding reverse case for any alphabet.
#include<stdio.h> #include<ctype.h> void main() { char alph,rev; printf("Enter an alphabet : "); scanf("%c", &alph); if(islower(alph)) rev = toupper(alph); else rev = tolower(alph); printf("Reverse case of %c is : %c\n", alph, rev); }Output:
$ cc reverse_case.c $ ./a.out Enter an alphabet : W Reverse case of W is : w $ ./a.out Enter an alphabet : r Reverse case of r is : R
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page