Thursday, 16 February 2012

Program to change the string from upper case to lower case


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char n[100];
int i=0,p=0;
clrscr();
printf("Enter the string  ");
gets(n);
while(n[i]!='\0')
{
i++;
}
printf("Length of string is:  %d",i);


p=i;
while(p>=0)
{
if(n[p]>=65 && n[p]<=90)
n[p]=n[p]+32;
p--;
}
printf("The lower case string is: ");
puts(n);
getch();
}

No comments:

Post a Comment