int main (void)
{
float food, tax, ntax, total, ntotal, ftotal;
int twentytotal, tentotal, fivetotal, onetotal, quartertotal, dimetotal, nickeltotal, pennietotal;
cout<<setw(8)<<fixed<<setprecision(2);
cout << "input cost of food" << endl;
cin >> food;
cout << "input sales tax raging from 4.3% to 11%" << endl;
cin >> tax;
ntax=tax/100;
total=food*ntax;
ntotal=total+food;
twentytotal = ntotal / 20;
cout <<"You get back "<< twentytotal << " twenty dollar bill(s)"<<endl;
tentotal = ((ntotal - (20*twentytotal))/10);
cout << "You get back "<<tentotal <<" ten dollar bill(s)"<< endl;
fivetotal = ((ntotal - ((20*twentytotal)+(10*tentotal)))/5);
cout << "You get back " <<fivetotal<< " five dollar bill(s)" << endl;
onetotal = (ntotal- ((20*twentytotal)+(10*tentotal)+(5*fivetotal)));
cout<<"You get back "<<onetotal<<" one dollar bill(s)"<<endl;
quartertotal = (((ntotal*100) - ((2000*(twentytotal))+(1000*(tentotal))+(500*(fivetotal))+(100*(onetotal))))/25);
cout<<"You get back " << quartertotal<< " quarter(s)"<<endl;
dimetotal = (((ntotal*100) - ((2000*(twentytotal))+(1000*(tentotal))+(500*(fivetotal))+(100*(onetotal))+(25*quartertotal)))/10);
cout<<"You get back "<<dimetotal<<" dime(s)"<<endl;
nickeltotal = (((ntotal*100) - ((2000*(twentytotal))+(1000*(tentotal))+(500*(fivetotal))+(100*(onetotal))+(25*quartertotal)+(10*dimetotal)))/5);
cout<<"You get back " <<nickeltotal<<" nickel(s)"<<endl;
pennietotal = ((ntotal*100) - ((2000*(twentytotal))+(1000*(tentotal))+(500*(fivetotal))+(100*(onetotal))+(25*quartertotal)+(10*dimetotal)+(5*nickeltotal)));
cout<<"You get back " <<pennietotal<< " pennie(s)"<<endl;
system("pause");
ntotal = valuePassingExample (ntotal);
cout << endl;
cout << "New total = "<< ntotal << endl << "\n";
percent is a char but you are doing a comparison with an int. Plus, you are using a char and not a char array, which will only give you the first char. If you want to use an int, change percent to an int, otherwise use a char array and use "" around the value when doing the comparison. For this exercise, i would strongly recommend using an int instead of a char[]