Tuesday 17 March 2015

To convert uppercase characters to lowercase Using C

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

void main()
{
char str[80], con[80] , ch ;
int i = 0 ;
clrscr() ;
printf("Enter the text in uppercase : ") ;
gets(str) ;
printf("\nThe converted text is : \n\n") ;
while(str[i] != '\0')
{
if(str[i] != ' ')
printf("%c", str[i] + 32) ;
else
putchar(' ') ;
i++ ;
}
getch() ;
}

RUN 1 :
~~~~~~~
Enter the text in uppercase : Anna University
The converted text is :
anna university

No comments:

Post a Comment