Wednesday, September 17, 2008

c programming language -- CONVERSION FROM LOWER CASE TO UPPER CASE

24. CONVERSION FROM LOWER CASE TO UPPER CASE

void main()
{
char str[20];
int i;
clrscr();
printf("Enter any string->");
scanf("%s",str);
printf("The string is->%s",str);
for(i=0;i<=strlen(str);i++)
{
if(str[i]>=97&&str[i]<=122)
str[i]=str[i]-32;
}
printf("\nThe string in lowercase is->%s",str);
getch();
}

No comments:

Post a Comment

Thanks to given comments.......

My Blog List