Write a C program to convert uppercase string into lowercase string.
Answers
Answer:
The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts a lowercase alphabet to an uppercase alphabet. It is defined in the ctype.h header file.
Explanation:
I hope get your answer
Answer:
Write a C program to convert uppercase string into lowercase string.
Explanation:
* C program to convert uppercase string to lower case
#include<stdio.h>
#include<string.h>
int main(){
/* This array can hold a string of upto 25
* chars, if you are going to enter larger string
* then increase the array size accordingly
*/
char str[25];
int i;
printf("Enter the string: ");
scanf("%s",str);
for(i=0;i<=strlen(str);i++){
if(str[i]>=65&&str[i]<=90)
str[i]=str[i]+32;
}
printf("\nLower Case String is: %s",str);
return 0;
}
Output:-
Enter the string: CAT
Lower case string: cat