Hello everyone,
I am working on a problem and I am not sure of the syntax for the toupper command. What I am trying to solve is when a user enters a string of characters C goes out and changes them to all upper case.
Here is what I have so far using a char array and gets and puts commands just not sure in the puts command how you integrate the toupper.
Thanks in advance
DMKanz07
Code:#include <stdio.h> #include <ctype.h> /* Function main begins program execution */ int main() { /* Create char array */ char s [ 100 ]; printf( "Enter a line of text: " ); /* Use gets to read line of text */ gets( s ); printf( "\n" ); printf( "The line printed in UPPER case: " ); puts ( toupper ( s ) ); printf( "\n" ); /* Indicates successful termination */ return 0; } /* End Main */