#include <stdio.h>
int main(){
char c;
while((c = getchar()) != EOF){
if(c >= 'A' && c <= 'Z')
c = c - 'A' + 'a';
putchar(c);
}
return 0;
}
Came across this C code in MIT's Practical Programming in C. Can anyone explain how this program works?
The program converts any input into lower case output.
You would have recognized this yourself, if you ran it, debugged it, or just made a paper test for this.