Convert String from lowercase to uppercase
#include<stdio.h>
#include<string.h>
int main()
{
char str[50];
int i,b=0;
printf("Enter lowercase word: ");
scanf("%s",str);
b=strlen(str);
for(i=0;i<=b;i++)
{
if(str[i]>=97&&str[i]<=122)
str[i]=str[i]-32;
}
printf("\nThe string in Uppercase is:%s",str);
return 0;
}
#include<stdio.h>
#include<string.h>
int main()
{
char str[50];
int i,b=0;
printf("Enter lowercase word: ");
scanf("%s",str);
b=strlen(str);
for(i=0;i<=b;i++)
{
if(str[i]>=97&&str[i]<=122)
str[i]=str[i]-32;
}
printf("\nThe string in Uppercase is:%s",str);
return 0;
}
//CONVERT STRING UPPERCASE TO LOWERCASE
ReplyDelete#include
#include
main()
{
char rose[50];
int i,manoshe=0;
printf("Enter the uppercase word: ");
scanf("%s",rose);
manoshe=strlen(rose);
for(i=0;i<=manoshe;i++)
{
if(rose[i]>=65&&rose[i]<=90)
rose[i]=rose[i]+32;
}
printf("\nThe string is lowercase is: %s\n",rose);
return 0;
}
Carry on.All the best
ReplyDelete