Question: i.e. user inputs NAME (all in capital) and the code will print out NnAaMmEe.

i want to use the function argv and args. this is the code so far

```
#include <stdio.h>
#include <conio.h>
#include <string.h>

void main(){
    int i;
    int count;
    char str [100];

    clrscr();

    printf("Enter a string");
    scanf("%s", str);

    count = strlen(str);
    for(i=0; i<=count; i++){
        if((str[i] >= 97) && (str[i] <= 100)){
            str[i] = str[i] - 32;
        }
        for(i=0; i>=count; i++){
            if ((str[i] <97) && (str[i] >100)){
                str[i] = str[i] +32;                
            }
        }
        printf("%s", str);
        getch();
    }
}

```

Answer: 
Your code is incorrect in several ways:

* Since you want to use `argc` and `argv`, you need to add them as parameters of `main`, and remove the call of `scanf`
* You do not need nested loops for this - only one loop is sufficient
* If you take length of string with `strlen`, your loop should go from 0 to `len-1`, i.e. you should use `<` or `!=`, not `<=` in your loop condition
* You do not need to perform non-portable numeric manipulations on the characters; use `tolower` and `toupper` functions instead.
* Printing should be done character-by-character, not the whole string

The body of your loop should looks something like this:

```
char ch = ... // Get i-th character of argv[1]
printf("%c%c", tolower(ch), toupper(ch));

```

Print `\n` after the loop to flush the buffer:

```
printf("\n");

```
You can use the `toupper` and `tolower` functions for converting the values into lower and upper. Use another array to store that values.

In loop,

```
for ( i=0 , j=0 ; i < len ; i++) {
      if ( isupper ( str[ i]) ) {
           str1 [j++]= str [i] ;
           str1 [j++]=tolower(str[i]);
      }
      else if ( islower (str [i ] ) ) {
             str1[j++]= toupper (str[i]);
             str1[j++ ]= str [i]; 
      }
}

```

Then make sure that variables are declared.