Explain what tolower does to a character The answer should i
Explain what tolower() does to a character. The answer should include the argument(s) that are passed to tolower() (if any) and what it returns.
Solution
Tested on Ubuntu,Linux
/***************explanation with program**********/
The syntax for the tolower function in the C Language is:
int tolower(int c);
It takes a value to be convert into lowercase. If passed parameter value is already in lowercase then it returns same value otherwise it converts into lowercase.
Header file for tolower function is given below
#include <ctype.h>
/***********Example for converting to lower case**********/
#include <stdio.h>
#include <ctype.h>
/*Main function start*/
int main(){
/* Define a variable and set it to \'Z\' */
int letter = \'Z\';
int res=tolower(letter);//calling tolower function and saving result into res variable
/*Printing lower case value*/
printf(\"Z tolower = %c\ \",res);
/*Returning value to OS*/
return 0;
}
/*Main function End*/
/***********output************/
raj@raj:~/Desktop/chegg$ gcc test.c
raj@raj:~/Desktop/chegg$ ./a.out
Z tolower = z
If you have any query please feel free to ask .
Thanks a lot
