Convert Uppercase to Lowercase using Predefined Function in C
This program is a C program that takes a string as input from the user and converts it to lowercase.
- The header file "stdio.h" is included, which contains the standard input/output library functions.
- The "main()" function is defined as the starting point of the program.
- A character array "a" with 100 elements is declared to store the string input by the user.
- The "printf()" function is used to print the prompt "Enter the string:".
- The "gets()" function is used to get the string input from the user.
- The "strlwr()" function is used to convert the string stored in the "a" array to lowercase.
- The "puts()" function is used to print the lowercase string.
- The "return 0;" statement is used to indicate that the program executed successfully.
Source Code
#include<stdio.h>
int main()
{
char a[100];
printf("\nEnter the string:");
gets(a);
strlwr(a);
puts(a);
return 0;
}
To download raw file
Click Here
Output
Enter the string: TUTOR JOE'S
tutor joe's