pls help i wrte a fuction that finds curency exchnages between turkish lira dolar and mark
my code is :#include <stdio.h>
#include <conio.h>
double result;
char fc,tc,value;
double amount;
float currency(char from_currency,char to_currency,double amount) {
switch(from_currency) {
case 't':
switch(to_currency) {
case 'd':
result=amount/550000.0;
value='D';
break;
case '$':
result=amount/1345000.0;
value='$';
break;
} //end of nested switch_1
break; //break of case't'
case 'd':
switch(to_currency) {
case 't':
result=550000.0*amount;
value='TL';
break;
case '$':
result=550000*amount/1345000.0;
value='$';
break;
} //end of nested switch_2
break; //brak of case 'd'
case '$':
switch(to_currency) {
case 't':
result=1345000.0*amount;
value='TL';
break;
case 'd':
result=1345000*amount/550000.0;
value='D';
break;
} //end of nested switch_3
break; //break of case'$'
} // end of main switch()
return result;
} // end of function
void menu() {
clrscr();
printf("enter from_currency to_currency and amount of money\n");
printf("for turkish lira use (t) for dolar use($) for mark use(d)\n");
scanf("%c %c %l",&fc,&tc,&amount);
} //end of menu
void main() {
menu();
printf("\nresulting amount is %f %c",currency(fc,tc,amount),value);
getch();
} //end of main();
when i enter $ for dolar d for mark and amount of dolar
result is 0.0000 and after the result it should give the value of money($,tl,d) but it doesnt
pls help what is the problem???