Write a function that accepts a string and converts it into lowercase

#include<stdio.h>
#include<conio.h>

void strlwr(char[]);
void main()
{
char a[80];
clrscr();
printf("Enter any string\n");
gets(a);
printf("String in lower case\n");
strlwr(a);
getch();
}
void strlwr(char a[])
{

int i;
for(i=0;a[i];i++)

if(a[i]>='A'&&a[i]<='Z')
 a[i]=a[i]+32;
 else
 a[i]=a[i];


printf("%s",a);
}

1 comment:

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number