#include<stdio.h>
int main()
{
char a[50];
int i=0;
printf("Enter a lowercase String: ");
gets(a);
while(a[i]!='\0')
{
if(a[i]>95 && a[i]<122)
printf("%c",a[i]-32);
else
printf("%c",a[i]);
i++;
}
return 0;
}
OUTPUT:
Enter a lowercase String: simpleway2code
SIMPLEWAY2CODE
4 Comments
what to change for uppercase to lowercase>?
ReplyDeletelowercase to uppercase means small letters will be converted into Capital letters
ReplyDeletesorry i meant can u tell me the program to change uppercase to lowercase,should the only change be a[i]+32 tochange tolowercase
Deleteya.... it will work
Delete