Convert the ada code to its C .
- by maddy
HI All,
I have a piece of ada code shown below which is a simple switch case statements.Is there any better way to convert this into C.
for I in 1..100 loop
case I is
when 100 =>
Dollars := Dollars + 1;
when 25|50|75 =>
Quarters := Quarters + 1;
when 10|20|30|40|60|70|80|90 =>
Dimes := Dimes + 1;
when 5|15|35|45|55|65|85|95 =>
Nickles := Nickles + 1;
when others =>
Pennies := Pennies + 1;
end case;
end loop;
Now by adding the switch and the case for each values in the case,i can do that conversion,But it seems tyo make the code too big.Is there anywa other simple and compact way.Please get back to me if the question is not clear?
Regards
maddy