/* Implement a C program that receives through the command line a string as input. The program must transform the content of the string in uppercase letters and print it on the screen. The option '-c ' between the name of the program and the string is used to convert and print only the first characters of the string. */ #include #include #include #include #define LEN 50 int main(int argc, char *argv[]) { int i; char s[LEN+1]; int string_length; /* Running the program as follows: prog_name.exe -c 4 sTriNg the variables *argv[] and argc contains the following values: argv[0]="prog_name.exe" argv[1]="-c" argv[2]="4" argv[3]="sTriNg" argc=4 And the output of the program will be STRI */ if(argc==4){ /* If the user has specified the option -c */ string_length = atoi(argv[2]); strncpy(s, argv[3], string_length); s[string_length] = '\0'; }else{ /* If the only argument is */ strcpy(s, argv[1]); string_length = strlen(s); } for(i=0; i