Write a program that converts all lowercase characters in a given string to its
equivalent uppercase character.
#include <ctype.h>
#include <stdio.h>
int main()
{
char* tmp;
char str[] = "String Test One";
printf("Source string: '%s'\n", str);
tmp = str;
while(*tmp)
{
if(islower(*tmp))
{
*tmp = toupper(*tmp);
}
++tmp;
}
printf("Result string: '%s'\n", str);
return 0;
}
Comments
Leave a comment