where do i insert the LowUpp(); function into my main(); to get it to make the lowercase letters into uppercase?
Code:#include <stdio.h>
int LowUpp(int ch)
{
if ( 'a' <= ch && ch <= 'z' )
{
return (ch + 'A' - 'a');
}
else
{
return ch;
}
}
int main()
{
int LowUpp(int ch);
char word[50];
char userstring[1024];
int wordcount = 0;
int charcount = 0;
int i = 0;
int j = 0;
printf("Enter your input: ");
if(fgets(userstring, 1024, stdin) == NULL)
return 0;
while(userstring[i] != '\0')
{
if((userstring[i] != ' ') && (userstring[i] != '\n') && (userstring[i] != '\t'))
{
charcount++;
word[j++] = userstring[i];
}
else
{
word[j] = '\0';
printf("%s \n", word);
wordcount++;
j = 0;
}
i++;
}
printf("There were %d words and %d characters.\n", wordcount, charcount);
return 1;
}