About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Tuesday, September 3, 2013

C Program to Convert String into Lowercase Using Library Function

Program 1 :
#include
#include
#include
void main()
{
char *string = "Pritesh Taral";
printf("String before to strlwr : %sn", string);

strlwr(string);

printf("String after strlwr : %sn", string);
getch();
}
Output :
String before to strlwr : Pritesh Taral
String after strlwr : pritesh taral

Program 2 :
#include
#include
#include
void main()
{
char string[100];

printf("Enter String : ");
gets(string);

strlwr(string);

printf("String after strlwr : %sn", string);
getch();
}
Output :
Enter String : Pritesh Taral
String after strlwr : pritesh taral
Explain me ?
  1. strlwr : Converts all Letters from given String into equivalent Lowercase Letters
  2. strlwr functions is included in Header File : string.h

No comments: