Program that fixes sentence case.
Hello, I just joined, hope I'm doing this right....!
So, for my computer programming class, we have to write a few programs for each assignment. Programming is just over my head - I'm awful with computers. I was wondering if I could get some assistance here. ^^;...
We need to write a program that will take a sentence and put it in lowercase and capitalize what is appropriate (like the first letter after a period or an exclamation point).
This is what I have so far...
Code:
#include <stdio.h>
int main()
{
int firstletter = 0;
while ((c = getchar())) !=EOF)
{
if (firstletter == 0)
{
upper = toupper(c)
putchar(upper)
firstletter++;
}
}
return 0;
}
I got some help from someone and this is what we came up with. It capitalizes the first letter right? I find this all so hard to understand... Thanks for taking the time to look at my problem.