-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha15f4.c
55 lines (50 loc) · 1.45 KB
/
a15f4.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<stdio.h>
#include"genlib.h"
#include"simpio.h"
int menu(){
int choice;
printf("1. Metatroph se dollaria\n");
printf("2. Metatroph se lires\n");
printf("3. Metatroph se fraga Elbetias\n");
printf("4. Metatroph se dollaria Canada\n");
printf("5. Metatroph se gen\n");
printf("6. Exodos\n");
choice=(printf("Dwse thn epilogh sou:"),GetInteger());
return choice;
}
double converter(int choice,double euros){
double result;
if (choice==1){
result=euros/0.89;
}else if(choice==2){
result=euros/0.618;
}else if(choice==3){
result=euros/1.5465;
}else if(choice==4){
result=euros/1.3565;
}else{
result=euros/109.22;
}
return result;
}
int main(){
int choice=menu();
double euros,worth;
while(choice!=6){
euros=(printf("Dwse poso se euro: "),GetReal());
worth=converter(choice,euros);
if (choice==1){
printf("To poso se dollaria einai:%.2f\n\n",worth);
}else if(choice==2){
printf("To poso se lires einai:%.2f\n\n",worth);
}else if(choice==3){
printf("To poso se fraga ELbetias einai:%.2f\n\n",worth);
}else if(choice==4){
printf("To poso se dollaria Canada einai:%.2f\n\n",worth);
}else{
printf("To poso se gen einai:%.2f\n\n",worth);
}
choice=menu();
}
return 0;
}