hi.i have several if and else if,but the last if only check one if what's the problem.
plz help
Code:
if(strcmp(func,"add")==0 || strcmp(func,"ADD")==0)
{
//some orders.
}
else
{
if(strcmp(func,"multiply")==0 || strcmp(func,"MULTIPLY")==0)
{
//some orders
}
else
{
if(strcmp(func,"transpose")==0  || strcmp(func,"TRANSPOSE")==0)
{
//some orders
}
else
{
if(strcmp(func,"sort")==0  || strcmp(func,"SORT")==0)
{
//some orders
}
else
{
if(strcmp(func,"compare")==0  || strcmp(func,"COMPARE")==0)
{
//some orders
}
else
{
cout<<"you have entered wrong answer\n"
}}}}}
but when you entered "sort" ,program sort but print you have entered wrong answer too.
what should i do??