please help in loan code !!!!

June 22, 2011 at 00:39:38
Specs: Windows 7
help me in
{
char loan = yes, no;

if (loan == yes)
printf (" loan : Yes");

if (loan == no)
printf ("loan : Zero")
}


See More: please help in loan code !!!!

Report •

#1
June 22, 2011 at 02:24:39
char loan = yes, no;

"no" is undefined, so its value could be anything; similarly, the value of "yes" isn't known from what you've posted.

what you might try is something like

char loan = 'y',  yes = 'y',  no = 'n';

if(loan == yes) {
   // loan is equal to the variable "yes" or the value 'y'
} else if(loan == no) {
   // loan is equal to the variable "no" or the value 'n'
} else {
   // loan is some value other than 'y' or 'n'
}

HTH


Report •
Related Solutions


Ask Question