Change String into Lowercase
C program for Change String into Lowercase
#include<stdio.h>
#include<conio.h>
void low_str (char[]);
int main()
{
char string[100];
printf("Enter a string to convert it into Lower case : ");
gets(string);
low_str(string);
printf("Entered String converted into lower case is: \"%s\"\n", string);
return 0;
}
//function for string convert into lower string
void low_str(char s[])
{
int c=0;
while(s[c]!='\0')
{
if(s[c]>='A' && s[c]<='Z')
{
s[c]=s[c]+32;
}
c++;
}
}
output
Enter a string to convert it into Lower case : Raman IS A gOOd Boy
Entered String converted into lower case is: "raman is a good boy"
#include<stdio.h>
#include<conio.h>
void low_str (char[]);
int main()
{
char string[100];
printf("Enter a string to convert it into Lower case : ");
gets(string);
low_str(string);
printf("Entered String converted into lower case is: \"%s\"\n", string);
return 0;
}
//function for string convert into lower string
void low_str(char s[])
{
int c=0;
while(s[c]!='\0')
{
if(s[c]>='A' && s[c]<='Z')
{
s[c]=s[c]+32;
}
c++;
}
}
output
Enter a string to convert it into Lower case : Raman IS A gOOd Boy
Entered String converted into lower case is: "raman is a good boy"
Comments
Post a Comment