Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

error messages

piczimpiczim Posts: 11Member
I have two error messages in the code below that I have no idea what they mean. Knot knowing what they mean means that I am unable to fix them.

The errors are

error: switch quantity not an integer
error case label does not reduce to an integer constant




#include

int main(int argc, char *argv[])
{
float inputamount, result;

printf("

Enter amount to be converted");
printf("
in the form SA, where the");
printf("
where the two letters represent");
printf("
a country.");
printf("
ad = Australian dollars.");
printf("
gb = British Pounds.");
printf("
jp = Japenes yen.");
printf("
vd= Vitnames dollars.");
printf("

Enter amount to convert: ");

switch(inputamount)
{

case "ad":
result = inputamount * 1.044;
break;

case "gb":
result = inputamount / 0.63;
break;

case "jp":
result = inputamount * 95.057;

case "vd":
result = inputamount * 2.106;

break;

default:
Sign In or Register to comment.