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");

```
Modify your program as below, You can obtain the output as you expected. The ascii range of capital letters is from 65 to 90 and for small letters it is 97 to 122. 

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

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

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

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

```

Input : `NAME`
Output : `NnAaMmEe`