Q:

So I'm writing a voting program in C and I can't come up with a for loop to count total votes

So below is the program I am trying to run. The part I am having trouble with is running 
a for loop to count total amount of votes. I don't understand why total_votes += col_totals[i] doesn't work. When I run the program I get an total number that makes no sense. eg. 42003993.
int main()
{
    int votes[5][4]={192,48,206,37,
                     147,90,312,21,
                     186,12,121,38,
                     114,21,408,39,
                     267,13,382,29};

    char cand[4]={'A','B','C','D'};

    int row_totals[5];
    int col_totals[4];

    int row, col;
    for(col=0;col<=3;col++) {
        col_totals[col]=0;
        for(row=0;row<=4;row++) {
            col_totals[col] += votes[row][col];
        }
    }

total_votes is what I'm having trouble with. I have to create a for loop using either row_totals or col_totals to calculate the total votes. This is what I have:
   int total_votes;
   int i;
   for (i=0; i<=3; i++) {

      total_votes += col_totals[i];
   }

    float percent[4]; //Not finished yet

    for(row=0;row<=4;row++)
    {
        row_totals[row]=0;

        for(col=0;col<=3;col++)
        {
            row_totals[row] += votes[row][col];
        }
    }

Here's the rest of the code just for reference: It won't let me post without adding more detail so here's some filler text.   
    printf("            Candidate   Candidate   Candidate   Candidate   Total\n");
    printf(" Precinct       A           B           C           D       Votes\n");
    for(row=0;row<=4;row++)
    {
        printf("%6d",row+1);
        for(col=0;col<=3;col++)
        {
            printf("%12d",votes[row][col]);
        }
        printf("%11d\n",row_totals[row]);
    }
   printf("\nTotal:");
   for (col = 0; col <=3; col++) {
      for(row=0;row<=4;row++);
      {
         printf("%12d",col_totals[col]);
      }
   }
   printf("%11d\n", total_votes);
    return 0;

}

A:

int total_votes = 0;

You start by += total_votes but what is total_votes initially? Without setting it to 0, it is a random number that the memory address it is given held before you created the variable

