Q:

How to count the number of times a character symbol appears in a text file?

I am trying to write a program that reads in a text file and then counts the number of times a symbol (user's choice from the command line argument) appears throughout the text file. It then writes the number of times it appears to an output text file. My problem is that it doesn't successfully print symbols or numbers, whereas if I count the number of times a LETTER appears it works fine.
For example, if input.txt contains:
Hello my name is programmer!!

Then running:
$ gcc myProgram.c
$ ./a.out input.txt output.txt !

Note First argument: input.txt , Second argument: output.txt , Third argument: !
This should print:
$ cat output.txt
The character being written was '!' and it occurred 2 times.
$

However, it prints nothing.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(int argc, char *argv[]){

    FILE *finp;
    FILE *output;
    char letter;

    int ex=0;

    if((finp=fopen(argv[1], "r")) == NULL){

        printf("Error Reading input!\n");

    }

    while((letter = fgetc(finp))!=EOF){

        /*From ASCII TABLE*/
        if(letter==33){
            ex++;}}

    if(output=fopen(argv[2], "w")){

        if(strcmp(argv[3],"!")==0){
            fprintf(output, "The character being written was '%s' and it occured %d
                    times", argv[3], ex);
        }

        if(output==NULL){
            printf("ERROR\n");
            exit(1);
        }

    }
    fclose(finp);
}

A:

There are numerous little changes required, most of them identified in the comments.  Here's the code fixed more or less the way I'd do it.
Source code: lc.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
    FILE *finp;
    FILE *output;
    int symbol;
    int letter;
    int count = 0;

    if (argc != 4)
    {
        fprintf(stderr, "Usage: %s input output symbol\n", argv[0]);
        exit(1);
    }

    if ((finp = fopen(argv[1], "r")) == NULL)
    {
        fprintf(stderr, "Error opening file %s for input\n", argv[1]);
        exit(1);
    }

    if ((output = fopen(argv[2], "w")) == NULL)
    {
        fprintf(stderr, "Error opening file %s for output\n", argv[2]);
        exit(1);
    }

    symbol = argv[3][0];

    while ((letter = fgetc(finp)) != EOF)
    {
        if (letter == symbol)
            count++;
    }

    fprintf(output, "The character being written was '%c' and it occurred %d times\n",
            symbol, count);

    fclose(finp);
    fclose(output);
    return 0;
}

Sample build and run
This assumes a suitable makefile exists to give you the compilation flags shown.  It's a subset of the flags I actually use, but the extra flags don't yield any extra warnings (errors) on this code.
$ make lc
    gcc -O3 -g -std=c11 -Wall -Wextra -Werror lc.c -o lc 
$ cat input.txt
Hello my name is programmer!!
$ ./lc input.txt output.txt !
$ cat output.txt
The character being written was '!' and it occurred 2 times
$ ./lc input.txt output.txt e
$ cat output.txt
The character being written was 'e' and it occurred 3 times
$ ./lc input.txt output.txt m
$ cat output.txt
The character being written was 'm' and it occurred 4 times
$ ./lc input.txt output.txt Z
$ cat output.txt
The character being written was 'Z' and it occurred 0 times
$ 

Note how inconvenient this program design is.  Each time you run the program, you have to run cat output.txt or something similar to see what was produced.  There's a reason why programs write to standard output in preference to files, and this illustrates why.  Yes, I could use:
$ ./lc input.txt /dev/stdout o
The character being written was 'o' and it occurred 2 times
$ 

but it would be more convenient not to need to do so.
Since the symbol to be counted is pretty much mandatory, it should be the first argument.  The second argument should be optional but could specify the input file; if it is not supplied, the program would read standard input.  The third argument could also be optional, specifying the output file, defaulting to standard output:
Usage: lc symbol [input [output]]

Alternatively, and probably both more usefully and more conventionally, it should always write to standard output, and should read all the files on the command line after the mandatory symbol argument:
Usage: lc symbol [file ...]

If you want the output to go to a file, use I/O redirection.  Or allow the output to be specified via an option and argument:
Usage: lc [-o output] symbol [file ...]

or:
Usage: lc [-o output] -c symbol [file ...]

There's a cogent argument for suggesting that a mandatory argument should not need the -c prefix.  On the other hand, you could generalize the code so that if the -c symbol was not specified, it would do a count of all the symbols in the file, and generalize the printing so it printed out all the characters with a non-zero count, or even all the counts regardless.  You might also allow -c symbol to repeat, or track all the characters in the string after the -c.  There are many ways to vary this program usefully.

A:

There were several errors and some warnings raised by the compiler for the posted code.
Here is a version with the errors/warnings corrected:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
    FILE *finp   = NULL;
    FILE *output = NULL;
    int   letter; // character to be found

    int ex=0; // character occurrence counter

    if( 4 != argc )
    { // then wrong number of parameters.
        printf( "usage: %s <inFileName> <outFileName> <searchChar>", argv[0] );
        exit( EXIT_FAILURE );
    }

    // implied else, right number of parameters

    if( NULL == (finp=fopen(argv[1], "r") ) )
    {
        perror( "fopen for the input file failed" );
        exit( EXIT_FAILURE );
    }

    // implied else, fopen successful

    if( NULL == (output=fopen(argv[2], "w") ) )
    {
        perror( "fopen for the output file failed" );
        fclose( finp ); // cleanup
        exit( EXIT_FAILURE );
    }

    // implied else, fopen successful

    while( EOF != (letter = fgetc(finp) ) )
    {
        /*From ASCII TABLE*/
        if( letter == argv[3][0] )
        { // then desired character found
            ex++;
        } // end if
    } // end while

    fprintf(
        output,
        "The search character is '%c' and it occurred %d times\n",
        argv[3][0],
        ex);

    fclose(finp);
    fclose(output);
    return 0;
} // end function: main

