Write a program that copies it's input to it's output. Replace each tab with \t, each backspace with \b, each backslash with \\.

Source:

#include "stdio.h"

int main(int argc, char *argv[])
{
  int running = 1;

  int character;

  printf("Enter a bunch of text and I will display backslash, tab, and newline!.\n[ctrl]+[d] to quit.\n");

  while(running)
  {
    character = getchar();

    /* 8 is backspace, this may be filtered out by the console. */
    if(character != '\n' && character != EOF && character != '\\' && character != '\t' && character != 8)
    {
      printf("%c", character);
    }
    else if(character == '\\')
    {
      printf("[\\\\]");
    }
    else if(character == '\t')
    {
      printf("[\\t]");
    }
    else if(character == '\n')
    {
      printf("[\\n]\n");
    }
    else if(character == 8)
    {
      printf("[\\b]");
    }
    else if(character == EOF)
    {
      printf("[EOF]\n");
      running = 0;
    }
  }

  return 0;
}

Output:

Enter a bunch of text and I will display backslash, tab, and newline!.
[ctrl]+[d] to quit.
Tab    backslash\newline
Tab[\t]backslash[\\]newline[\n]
[EOF]