write a program in c++ to convert to uppercase without using strupr
Answers
Answered by
2
int main( )
{
char str[80];
cout<<"Enter a string : ";
gets(str);
for(int i=0;str[i]!='\0';i++)
str[i]=(str[i]>='a'&&str[i]<='z')?str[i]-32):str[i];
puts(str);
}
{
char str[80];
cout<<"Enter a string : ";
gets(str);
for(int i=0;str[i]!='\0';i++)
str[i]=(str[i]>='a'&&str[i]<='z')?str[i]-32):str[i];
puts(str);
}
Similar questions