Hi,
Am trying to complete some work for university but have hit a brick wall,
previously in my code i have used a switch() no problem, but now when trying to use the below i get a error C2059: syntax error : '>', & '>=':
Can anyone explain why? gross_pay is working fine and its an integral so no worries there, its just the syntax error i can't get around for some reason
Any help greatly appreciated.
Am trying to complete some work for university but have hit a brick wall,
previously in my code i have used a switch() no problem, but now when trying to use the below i get a error C2059: syntax error : '>', & '>=':
Code:
switch (gross_pay)
{
case>0 && case<=300 : tax = .15 * gross_pay;
break;
case>=301 && case<=500 : tax = 45 + .2 * (gross_pay - 300);
break;
case>=501 && case<=650 : tax = 85 + .25 * (gross_pay - 500);
break;
case>=651 : tax = 122.5 + .3 * (gross_pay - 650);
break;
default : ;
}
printf("Total Tax payed is %d\n", tax);
Can anyone explain why? gross_pay is working fine and its an integral so no worries there, its just the syntax error i can't get around for some reason

Any help greatly appreciated.