How to write a Character toupper() Example in C Programming Language ?
Solution For C Program :
//C Program Character toupper() Example.
#include <stdio.h>
#include <ctype.h>
int main(){
char c;
scanf("%c", &c);
/*
1.
if( c >= 'a' && c <= 'z' ){
c -= ('a' - 'A');
}
*/
/*
2.
if( islower(c) ){
c -= ('a' - 'A');
}
*/
c = toupper(c);
printf("%c", c);
return 0;
}