Break the problem down into simpler achievable steps.
This is your first program.
Code:
int main ( ) {
char buff[100];
while(fgets(buff,sizeof(buff),stdin)) {
printf("%s",buff);
}
}
Prove you can just read input and print it back out.
This is your second program.
Code:
// Example: It paSsEs thE SwAn on thE waTeR
// it becomes: It passes the swan on the water
void Uppercase( char *buff ) {
// Write your code here.
}
int main ( ) {
char buff[] = "It paSsEs thE SwAn on thE waTeR\n";
Uppercase(buff);
printf("%s",buff);
}
Prove you can transform a given example.
When (and only when) both work, you can merge them together like so.
Code:
// Example: It paSsEs thE SwAn on thE waTeR
// it becomes: It passes the swan on the water
void Uppercase( char *buff ) {
// Write your code here.
}
int main ( ) {
char buff[100];
while(fgets(buff,sizeof(buff),stdin)) {
Uppercase(buff);
printf("%s",buff);
}
}