This function converts strings into upper case in C language. It is a simple one. I use ternary operator.
void UppCase(Char *str)
while(*str!=0)//traversing until end of atring
/* check whether the char is between ‘a’ and ‘z’. If it is subtract the ASCII value of ‘a’ and add ASCII value of ‘A’. Otherwise print the char as it is */
*str = (*str>=’a’ && *str <= ‘z’)?(*str-‘a’+’A’):*str;
str++;//increment pointer to next position