-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconversion.c
67 lines (58 loc) · 1.43 KB
/
conversion.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
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
int main()
{
char input;
float first;
float product;
float kmtomi = 0.621371;
float intofo= 0.0833333;
float cmtoin= 0.393701;
float potokg = 0.453592;
float intome = 0.0254;
while (1)
{
printf(" enter the character q to quit. \n 1. km to mile \n 2. inch to feet \n 3. cm to inch\n 4. pound to kg\n 5. inch to meter\n");
scanf("%c", &input);
switch (input)
{
case 'q':
printf(" quitting the program. \n");
goto end;
break;
case '1':
printf(" enter the value in first unit");
scanf("%f", &first);
product= first * kmtomi;
printf(" the value of %f km into miles is %f", first, product);
break;
case '2':
printf(" enter the value in first unit");
scanf("%f", &first);
product=first * intofo;
printf(" the value of %f inch into feet is %f", first, product);
break;
case '3':
printf(" enter the value in first unit");
scanf("%f", &first);
product= first * cmtoin;
printf(" the value of %f cm into inch is %f", first, product);
break;
case '4':
printf(" enter the value in first unit");
scanf("%f",& first);
product= first * potokg;
printf(" the value of %f pound into kg is %f", first, product);
break;
case '5':
printf(" enter the value in first unit");
scanf("%f", &first);
product= first * intofo;
printf(" the value of %f inches into meters is %f", first, product);
break;
default:
break;
}
}
end:
return 0;
}