I have this problem from school, (below is my code), i can turn the characters into uppeercase, but i dont know how to stop getting input, normally my teacher would give something like "the input ends when it encounter '1'", but this time his test case is just normal text:
the problem: Description Given a TEXT, write a program that converts the TEXT to upper-case.
Example
Input Hello John,
How are you?
Bye,
Output
HELLO JOHN,
HOW ARE YOU?
BYE,
my code:
#include <stdio.h>
int main(){
char c;
while(1){
scanf("%c", &c);
if(c == EOF) break;
else{
c = toupper(c);
printf("%c", c);
}
}
return 0;
}
my code proccesses uppercase request fine, but it never ends. Can you help me, thank you very much!