Swapping int with string using getchar() and putchar()
Review
Vertical White Space
You have way too many blank lines.
Please remove 90% of them.
Formatting
This code is horribly formatted.
Code is designed for humans to read. Part of that is making sure it is easy to read.
DRY
There is one piece of code that is repeated several times.
for (i = 0; str[i] != '\0'; i++) {
    putchar(str[i]);
}

You can simplify your code by putting this into its own function. Then calling the function when you want to print out the string.
Easier to read
Your comparisons to check for a number is overly complex:
else if(c==2+'0'){

The c is a character so simply compare the user input to the expected character:
 else if (c == '2') {