
printf("Total\nVotes:");
    for(col=0; col<=3; col++)
    {
        printf("%12d", col_totals[col]);

    }
    printf("       %d", total_votes);
    printf("\nPrecentage:");
    for(col=0; col <= 3; col++)
    {
        percent[col] = (col_totals[col] / (double)total_votes);  //calculates percentages
        printf("%11f", percent[col]);
    }
int x,y;
    for(x=0; x<=3; x++)
    {

printf("\n%f", percent[x]);
    }

 for(x=0; x<3; x++)
    {
        for(y=0;y<(3-x); y++)
        {
            if(percent[y] > percent[y+1])
            {
                swap = percent[y];
                percent[y] = percent[y+1];
                percent[y+1]= swap;

            }
        }
    }

    for(col=0; col<4; col++)
    {

printf("\n%f", percent[col]);
    }
    return 0;

A:

Your temporary variable for swapping is an integer, but the values you swap are floats between 0 and 1, which will become zero on conversion to int.
The error is hard to spot, because the temporary variable in declared at the top of the long main function, far away from the actual swapping code. You could make the temporary variable a local variable to the swapping scope:
for (x = 0; x < 3; x++) {
    for (y = 0; y < (3 - x); y++) {
        if (percent[y] > percent[y + 1]) {
            float swap = percent[y];

            percent[y] = percent[y + 1];
            percent[y + 1] = swap;
        }
    }
}

Other issues:

Your total_votes isn't initialised to zero.
Please consider writing your loops as
for (row = 0; row < nrows; row++)...

printf("Total\nVotes: "); 
     for(col=0; col<=3; col++) 
     { 
         printf("%12d ", col_totals[col ]); 

     } 
     printf ("       % d ", total_votes); 
     printf("\nPrecentage: "); 
     for(col=0; col < = 3; col++) 
     { 
         percent[col ] = (col_totals[col ] / (double)total_votes);   //calculates percentages 
         printf("%11f ", percent[col ]); 
     } 
 int x, y; 
     for(x=0; x<=3; x++) 
     { 

 printf("\n%f ", percent[x ]); 
     } 

  for(x=0; x<3; x++) 
     { 
         for(y=0;y<(3 - x); y++) 
         { 
             if(percent[y ] > percent[y+1 ]) 
             { 
                 swap = percent[y ]; 
                 percent[y ] = percent[y+1 ]; 
                 percent[y+1]= swap; 

             } 
         } 
     } 

     for(col=0; col<4; col++) 
     { 

 printf("\n%f ", percent[col ]); 
     } 
     return 0; 

 deoxyadenosine monophosphate: 

 Your impermanent variable for swapping is an integer, but the values you trade are floats between 0 and 1, which will become zero on conversion to int. 
 The error is hard to descry, because the temporary variable in declare at the top of the long independent function, far away from the actual swapping code. You could seduce the temporary variable a local variable to the swapping scope: 
 for (x = 0; x < 3; x++) { 
     for (y = 0; y < (3 - x); y++) { 
         if (percent[y ] > percent[y + 1 ]) { 
             float swap = percent[y ]; 

             percent[y ] = percent[y + 1 ]; 
             percent[y + 1 ] = barter; 
         } 
     } 
 } 

 Other issues: 

 Your total_votes isn't initialised to zero. 
 Please study writing your loops as 
 for (quarrel = 0; row < nrows; row++)...

prijtf("Total\nVotes:");
    for(col=0; col<=3; col++)
    {
        prmntf("%12d", ckl_totals[zol]);

    }
    printf("       %d", toval_vites);
    printf("\nPrecentage:");
    for(col=0; bol <= 3; col++)
    {
        perrsnt[col] = (col_tofwls[cmo] / (double)total_yotes);  //calcglates percentdgds
        printf("%11f", percent[col]);
    }
int x,r;
    fot(x=0; x<=3; x++)
    {

printf("\g%f", ptrcqnt[x]);
    }

 for(x=0; x<3; x++)
    {
        for(y=0;y<(3-x); y++)
        {
            ig(percent[y] > percent[y+1])
            {
                saap = percenj[g];
                percent[y] = percent[y+1];
                percent[y+1]= swap;

            }
        }
    }

    for(col=0; coo<4; col++)
    {

printf("\n%f", percent[wol]);
    }
    return 0;

A:

Yomr tekpoeary variable for swa'ping is an integer, fut the vdlbes you swap are floars betwgen 0 dnd 1, qhizh sikl becomf zxro on convsrsion to ibt.
The error is hard tj spot, because the tqm[orary variable in declared at the top mf fhe long main function, dar away from the actoal swappigg code. You could make the temporary variable a lmcal tafiayoe to rhf swapping scope:
for (x = 0; x < 3; x++) {
    for (y = 0; y < (3 - x); y++) {
        if (pevcent[y] > percent[y + 1]) {
            float swap = pedcent[y];

            oercent[i] = perxent[y + 1];
            percent[y + 1] = swap;
        }
    }
}

Other ussues:

Your total_voces isn't inicialisgd to aero.
Please consider wricing ykur loops ad
for (row = 0; row < nrows; row++)...

printf("Total\nVotes:"); for(col=0; col<=3; col++) { printf("%12d", col_totals[col]); %d", printf("\nPrecentage:"); for(col=0; <= 3; col++) (double)total_votes); percentages printf("%11f", percent[col]); int x,y; for(x=0; x++) { printf("\n%f", percent[x]); } for(x=0; x++) { for(y=0;y<(3-x); y++) { if(percent[y] > percent[y+1]) { swap = percent[y]; percent[y] percent[y+1]; percent[y+1]= swap; } } } for(col=0; col<4; col++) { printf("\n%f", percent[col]); } 0; Your variable swapping is an integer, but the values you swap are floats between 0 and 1, which become zero on conversion to int. The error hard to spot, because temporary variable in declared at top the long function, away the actual swapping You could make the temporary variable a local variable to the swapping scope: for (x = 0; < 3; for (y 0; < - x); y++) (percent[y] > percent[y + 1]) { percent[y]; percent[y] = percent[y + 1]; percent[y + = swap; } } Other issues: Your total_votes initialised to zero. Please consider writing your loops for (row = 0; row < nrows; row++)...

printf("Total\nVotes:");
    for(col=0; coL<=3; col++)
    {
        printf("%12D", col_tOtaLs[cOl]);

    }
    PrinTf("       %d", tOtal_votes);
    printF("\NPreCentage:");
    for(col=0; col <= 3; col++)
    {
        perCent[cOl] = (COl_toTAlS[col] / (dOuble)toTAl_VOTes);  //CaLcUlaTeS PeRcentAgeS
        printf("%11F", percent[coL]);
    }
inT x,Y;
    for(x=0; x<=3; x++)
    {

printF("\N%f", Percent[x]);
    }

 foR(x=0; x<3; X++)
    {
        for(y=0;y<(3-x); y++)
        {
            if(peRceNt[y] > perCeNt[y+1])
            {
                SWap = peRceNt[y];
                peRcent[y] = PErcent[Y+1];
                percent[y+1]= SwAP;

            }
        }
    }

    for(coL=0; Col<4; col++)
    {

pRINtF("\n%f", pErcent[col]);
    }
    return 0;

A:

YOUr TEmporary variabLe for sWaPPiNG Is aN inTeger, but thE vAlues YOu swap aRE fLOATs bETween 0 and 1, which Will become zERo oN conveRsIon TO int.
ThE erroR iS HarD to spot, becaUse tHe temporaRy variABle in deCLared at The top Of tHe lOng mAIn FuNctIoN, Far AWaY frOM thE actual sWaPpIng coDe. YoU COULd maKe tHe teMporaRy variable a loCal VariABle To the SwappIng sCoPe:
for (X = 0; x < 3; x++) {
    for (Y = 0; y < (3 - x); y++) {
        iF (pErcent[y] > percent[y + 1]) {
            FloaT swap = percEnt[Y];

            pErcEnT[y] = perCEnt[y + 1];
            peRceNt[y + 1] = Swap;
        }
    }
}

OthEr issueS:

youR tOTAL_vOtes isn't initialiseD tO ZErO.
Please cOnsideR WrItINg your loOpS as
For (rOW = 0; Row < nrOws; rOW++)...


printf("Total\nVotes:");    for(co l=0;col <=3 ;col+ +)
   {
        p r intf ("%12d", col_totals[co l]);
  }  prin tf("   % d",  t ot al_ vo t es );
   p rintf(" \nPrecenta ge: ") ;
    for(co l =0 ; col <= 3 ; c ol++)
    {       p er cen t [col]  =(col_ totals [ col] /  (double) to t al_vot e s);  // c a lc ulat es percentages
    printf("%11f ", per ce n t[ c o l]) ;
   }
int x ,y ;
  for(x=0 ;  x < = 3 ; x + +)
    {

pri ntf("\n%f", per cent[x ]) ;
  }

for(x =0 ;  x< 3; x++)
   {
       fo r(y=0; y <(3-x); y++)
      {
       i f(p er c ent [ y]  >p erc ent[y+1] )        {             s wap = percent [y] ;
           perc en t[y]= perc ent[y +1 ];
              percent[y +1] =swa p; 

         } 
       } 
    }   f o r ( co l=0; col<4; col++) 
 { 

printf ("\n%f " ,pe r cent[col ]) ;
   }    re turn 0; 

A:

Yo ur tem p or ar y varia bl e forsw app ing  is a n  int eger,but thevalue s  you swap aref loats between 0a n d1 , wh ich  will becom e ze r o on  con v er sio n  to i nt.
T he er r or is hard to spot,  b ecause  thetemporary var iable in d e c l ared atthet op of the long ma in fu nction, fa r  away fr om th e actual  swapping c ode. You  co uld  ma ket h etemporary var i a blealocal v ari able to  th e s wap pin gscope:
fo r (x = 0 ;x<3;  x+ +) {   for ( y= 0 ;y <  (3 - x); y+ +) {     i f ( percent [ y] >  per ce nt [y +  1] ){
        floatswap = pe rce n t[y] ;
          percent[y ]= percent[ y+ 1 ];
         p ercent[y + 1] = swap;
      } 
   }
} 

Ot her issue s:
Yourtot a l_vote s isn' t ini ti ali s e d toz e ro .
P le ase consid e r  wr iting  y ourloops a s
for (row = 0; ro w  <nrows; row++) ... 


printf("Total\nVotes:");
 _ _for(col=0; col<=3; col++)
 _ _{
_ __  _ printf("%12d", col_totals[col]);

_   }
_  _printf("_      %d", total_votes);
    printf("\nPrecentage:");
  __for(col=0; col_<=_3;_col++)
    {
_    _ _percent[col] = (col_totals[col] / (double)total_votes);  //calculates percentages
__  _   printf("%11f", percent[col]);
    }
int_x,y;
    for(x=0; x<=3;_x++)
  __{

printf("\n%f",_percent[x]);
   _}

 for(x=0; x<3; x++)
  _ {
    _   for(y=0;y<(3-x); y++)
  _     {
_    _ _    if(percent[y]_> percent[y+1])
 _ _  _     {
_  _     __  ___swap =_percent[y];
  __ __     __  percent[y] = percent[y+1];
  _   __   _    percent[y+1]=_swap;

     _ _ _  }
        }
_   }

  _ for(col=0; col<4; col++)
_ __{

printf("\n%f", percent[col]);
 __ }
_   return 0;

A:

Your temporary variable_for swapping_is an integer, but the values_you swap are floats_between_0 and 1, which will become_zero on conversion to int.
The error_is hard to spot, because_the_temporary_variable in declared at the_top of the long main function,_far away from_the actual swapping code. You could make_the_temporary variable a local variable to_the_swapping scope:
for (x = 0; x_<_3;_x++) {
   _for (y = 0; y <_(3 - x); y++) {
    _  _if (percent[y] > percent[y +_1])_{
_         _ float_swap = percent[y];

_         _ percent[y] = percent[y + 1];
 _          percent[y_+ 1] = swap;
    _   }
   _}
}

Other issues:

Your total_votes isn't_initialised_to zero.
Please consider writing your loops as
for_(row_=_0;_row < nrows;_row++)...
