-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurrency Converter
More file actions
73 lines (55 loc) · 1.77 KB
/
Currency Converter
File metadata and controls
73 lines (55 loc) · 1.77 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <stdio.h>
int main()
{
float amount;
float rupee, dollar, pound, euro;
int choice;
printf("Following are the Choices:");
printf("\nEnter 1: Ruppe");
printf("\nEnter 2: Dollar");
printf("\nEnter 3: Pound");
printf("\nEnter 4: Euro");
printf("\nEnter your choice: ");
scanf("%d", &choice);
printf("Enter the amount you want to convert?\n");
scanf("%f", &amount);
switch (choice)
{
case 1: // Ruppe Conversion
dollar = amount / 70;
printf("%.2f Rupee = %.2f dollar", amount, dollar);
pound = amount / 88;
printf("\n%.2f Rupee = %.2f pound", amount, pound);
euro = amount / 80;
printf("\n%.2f Rupee = %.2f euro", amount, euro);
break;
case 2: // Dollar Conversion
rupee = amount * 70;
printf("\n%.2f Dollar = %.2f rupee", amount, rupee);
pound = amount *0.78;
printf("\n%.2f Dollar = %.2f pound", amount, pound);
euro = amount *0.87;
printf("\n%.2f Dollar = %.2f euro", amount, euro);
break;
case 3: // Pound Conversion
rupee = amount * 88;
printf("\n%.2f Pound = %.2f rupee", amount, rupee);
dollar = amount *1.26;
printf("\n%.2f Pound = %.2f dollar", amount, dollar);
euro = amount *1.10;
printf("\n%.2f Pound = %.2f euro", amount, euro);
break;
case 4: // Euro Conversion
rupee = amount * 80;
printf("\n%.2f Euro = %.2f rupee", amount, rupee);
dollar = amount *1.14;
printf("\n%.2f Euro = %.2f dollar", amount, dollar);
pound = amount *0.90;
printf("\n.2%f Euro = %.2f pound", amount, pound);
break;
//Default case
default:
printf("\nInvalid Input");
}
return 0;
}