-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunit_conversion.c
1549 lines (1174 loc) · 42 KB
/
unit_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include<stdio.h>
#include<math.h>
int main()
{
char option;
int l,o;
float a,b,c;
lable:
//while(1)
//{
printf("\n\t\t\tUNIT CONVERSION");
printf("\n\t\t\t -by nix");
printf("\n\n a.AREA b.DATA TRANSFER RATE");
printf("\n\n c.DIGITAL STROAGE d.ENERGY");
printf("\n\n e.FREQUENCY f.FUEL ECONOMY");
printf("\n\n g.LENGTH h.MASS");
printf("\n\n i.PRESSURE j.SPEED");
printf("\n\n k.TEMPURATURE l.TIME");
printf("\n\nEnter your option : ");
scanf(" %c", &option);
switch(option)
{
case 'a':
printf("\nyou choose area conversion");
printf("\n1. square kilometer to square meter");
printf("\n2. square kilometer to square mile");
printf("\n3. square kilometer to square inch");
printf("\n4. square kilometer to acre");
printf("\n5. square mile to square kilometer");
printf("\n6. square mile to square meter");
printf("\n7. square mile to square inch");
printf("\n8. square mile to acre");
printf("\n9. square inch to square kilometer");
printf("\n10.square inch to square meter");
printf("\n11.square inch to square mile");
printf("\n12.square inch to acre");
printf("\n13.square meter to square kilometer");
printf("\n14.square meter to square mile");
printf("\n15.square meter to square inch");
printf("\n16.square meter to arce");
printf("\n17.acre to square kilometer");
printf("\n18.acre to square meter");
printf("\n19.acre to square mile");
printf("\n20.acre to square inch");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("square kilometer to square meter\n\nsquare kilometer value :");
scanf("%f",&a);
b = a*1000000;
printf("%f square kilometer = %f square meter",a,b);
}
else if(l == 2)
{
printf("square kilometer to square mile\n\nsquare kilometer value :");
scanf("%f",&a);
b = a/2.58;
printf("%f square kilometer = %f square mile",a,b);
}
else if(l == 3)
{
printf("square kilometer to square inch\n\nsquare kilometer value :");
scanf("%f",&a);
b = a*1.550000000;
printf("%f square kilometer = %f square inch",a,b);
}
else if(l == 4)
{
printf("square kilometer to acre\n\nsquare kilometer value :");
scanf("%f",&a);
b = a*247.1;
printf("%f square kilometer = %f acre",a,b);
}
if(l == 5)
{
printf("square mile to square kilometer\n\nsquare mile value :");
scanf("%f",&a);
b = a*2.59;
printf("%f square mile = %f square kilometer",a,b);
}
else if(l == 6)
{
printf("square mile to square meter\n\nsquare mile value :");
scanf("%f",&a);
b = a*2.590000;
printf("%f square mile = %f square mile",a,b);
}
else if(l == 7)
{
printf("square mile to square inch\n\nsquare mile value :");
scanf("%f",&a);
b = a*4.014000000;
printf("%f square mile = %f square inch",a,b);
}
else if(l == 8)
{
printf("square mile to acre\n\nsquare mile value :");
scanf("%f",&a);
b = a*640;
printf("%f square mile = %f acre",a,b);
}
else if(l == 9)
{
printf("square inch to square kilometer\n\nsquare inch value :");
scanf("%f",&a);
b = a/1500000000;
printf("%f square inch = %f square kilometer",a,b);
}
else if(l == 10)
{
printf("square inch to square meter\n\nsquare inch value :");
scanf("%f",&a);
b = a/1550;
printf("%f square inch = %f square meter",a,b);
}
else if(l == 11)
{
printf("square inch to square mile\n\nsquare inch value :");
scanf("%f",&a);
b = a/4014000000;
printf("%f square inch = %f square mile",a,b);
}
else if(l == 12)
{
printf("square inch to acre\n\nsquare inch value :");
scanf("%f",&a);
b = a/6273000;
printf("%f square inch = %f acre",a,b);
}
else if(l == 13)
{
printf("square meter to square kilometer\n\nsquare meter value :");
scanf("%f",&a);
b = a/1000000;
printf("%f square meter = %f square kilometer",a,b);
}
else if(l == 14)
{
printf("square meter to square mile\n\nsquare meter value :");
scanf("%f",&a);
b = a/2590000;
printf("%f square meter = %f square mile",a,b);
}
else if(l == 15)
{
printf("square meter to square inch\n\nsquare meter value :");
scanf("%f",&a);
b = a*1550;
printf("%f square meter = %f square inch",a,b);
}
else if(l == 16)
{
printf("square meter to acre\n\nsquare meter value :");
scanf("%f",&a);
b = a/4047;
printf("%f square meter = %f acre",a,b);
}
else if(l == 17)
{
printf("acre to square kilometer\n\nacre value :");
scanf("%f",&a);
b = a/247.1;
printf("%f acre = %f square kilometer",a,b);
}
else if(l == 18)
{
printf("acre to square meter\n\nacre value :");
scanf("%f",&a);
b = a*4047;
printf("%f acre = %f square meter",a,b);
}
else if(l == 19)
{
printf("acre to square mile\n\nacre value :");
scanf("%f",&a);
b = a/640;
printf("%f acre = %f square mile",a,b);
}
else if(l == 20)
{
printf("acre to square inch\n\nacre value :");
scanf("%f",&a);
b = a*6273000;
printf("%f acre = %f square inch",a,b);
}
//else
//{
// printf("Enter wrong option");
//}
break;
case 'b':
printf("\nyou choose data transfer rate conversion");
printf("\n1. kilobyte to megabyte");
printf("\n2. kilobyte to gigabyte");
printf("\n3. kilobyte to terabyte");
printf("\n4. megabyte to kilobyte");
printf("\n5. megabyte to gigabyte");
printf("\n6. megabyte to terabyte");
printf("\n7. gigabyte to kilobyte");
printf("\n8. gigabyte to megabyte");
printf("\n9. gigabyte to terabyte");
printf("\n10.terabyte to kilobyte");
printf("\n11.terabyte to megabyte");
printf("\n12.terabyte to gigabyte");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("kilobyte to megabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f kilobyte = %f megabyte",a,b);
}
else if(l == 2)
{
printf("kilobyte to gigabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000000;
printf("%f kilobyte = %f gigabyte",a,b);
}
else if(l == 3)
{
printf("kilobyte to terabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000000000;
printf("%f kilobyte = %f terabyte",a,b);
}
else if(l == 4)
{
printf("megaobyte to kilobyte\n\nmegabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f megabyte = %f kilobyte",a,b);
}
else if(l == 5)
{
printf("megaobyte to gigabyte\n\nmegabyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f megabyte = %f gigabyte",a,b);
}
else if(l == 6)
{
printf("megaobyte to terabyte\n\nmegabyte value :");
scanf("%f",&a);
b = a/1000000;
printf("%f megabyte = %f terabyte",a,b);
}
else if(l == 7)
{
printf("gigaobyte to kilobyte\n\ngigabyte value :");
scanf("%f",&a);
b = a*1000000;
printf("%f gigabyte = %f kilobyte",a,b);
}
else if(l == 8)
{
printf("gigaobyte to megabyte\n\ngigabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f gigabyte = %f megabyte",a,b);
}
else if(l == 9)
{
printf("gigaobyte to terabyte\n\ngigabyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f gigabyte = %f terabyte",a,b);
}
else if(l == 10)
{
printf("teraobyte to kilobyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000000000;
printf("%f terabyte = %f kilobyte",a,b);
}
else if(l == 11)
{
printf("teraobyte to megabyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000000;
printf("%f terabyte = %f megabyte",a,b);
}
else if(l == 12)
{
printf("teraobyte to gigabyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f terabyte = %f gigabyte",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'c':
printf("\nyou choose digital storage conversion");
printf("\n1. kilobyte to megabyte");
printf("\n2. kilobyte to gigabyte");
printf("\n3. kilobyte to terabyte");
printf("\n4. megabyte to kilobyte");
printf("\n5. megabyte to gigabyte");
printf("\n6. megabyte to terabyte");
printf("\n7. gigabyte to kilobyte");
printf("\n8. gigabyte to megabyte");
printf("\n9. gigabyte to terabyte");
printf("\n10.terabyte to kilobyte");
printf("\n11.terabyte to megabyte");
printf("\n12.terabyte to gigabyte");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("kilobyte to megabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f kilobyte = %f megabyte",a,b);
}
else if(l == 2)
{
printf("kilobyte to gigabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000000;
printf("%f kilobyte = %f gigabyte",a,b);
}
else if(l == 3)
{
printf("kilobyte to terabyte\n\nkilobyte value :");
scanf("%f",&a);
b = a/1000000000;
printf("%f kilobyte = %f terabyte",a,b);
}
else if(l == 4)
{
printf("megaobyte to kilobyte\n\nmegabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f megabyte = %f kilobyte",a,b);
}
else if(l == 5)
{
printf("megaobyte to gigabyte\n\nmegabyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f megabyte = %f gigabyte",a,b);
}
else if(l == 6)
{
printf("megaobyte to terabyte\n\nmegabyte value :");
scanf("%f",&a);
b = a/1000000;
printf("%f megabyte = %f terabyte",a,b);
}
else if(l == 7)
{
printf("gigaobyte to kilobyte\n\ngigabyte value :");
scanf("%f",&a);
b = a*1000000;
printf("%f gigabyte = %f kilobyte",a,b);
}
else if(l == 8)
{
printf("gigaobyte to megabyte\n\ngigabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f gigabyte = %f megabyte",a,b);
}
else if(l == 9)
{
printf("gigaobyte to terabyte\n\ngigabyte value :");
scanf("%f",&a);
b = a/1000;
printf("%f gigabyte = %f terabyte",a,b);
}
else if(l == 10)
{
printf("teraobyte to kilobyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000000000;
printf("%f terabyte = %f kilobyte",a,b);
}
else if(l == 11)
{
printf("teraobyte to megabyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000000;
printf("%f terabyte = %f megabyte",a,b);
}
else if(l == 12)
{
printf("teraobyte to gigabyte\n\nterabyte value :");
scanf("%f",&a);
b = a*1000;
printf("%f terabyte = %f gigabyte",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'd':
printf("\nyou choose energy conversion");
printf("\n1.joule to kilojoule");
printf("\n2.kilojoule to joule");
printf("\n3.watt hour to kilowatt hour");
printf("\n4.kilowatt hour to watt hour");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("joule to kilojoule\n\njoule value :");
scanf("%f",&a);
b = a/1000;
printf("%f joule = %f kilojoule",a,b);
}
else if(l == 2)
{
printf("kilojoule to joule \n\njoule value :");
scanf("%f",&a);
b = a*1000;
printf("%f kilojoule = %f joule",a,b);
}
else if(l == 3)
{
printf("watt hour to kilowatt hour\n\nwatt hour value :");
scanf("%f",&a);
b = a/1000;
printf("%f watt hour = %f kilowatt hour",a,b);
}
else if(l == 4)
{
printf("kilowatt hour to watt hour\n\nkilowatt value :");
scanf("%f",&a);
b = a*1000;
printf("%f kilowatt hour = %f watt",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'e':
printf("\nyou choose frequency conversion");
printf("\n1. hertz to kilohertz");
printf("\n2. hertz to megahertz");
printf("\n3. hertz to gigahertz");
printf("\n4. kilohertz to hertz");
printf("\n5. kilohertz to megahertz");
printf("\n6. kilohertz to gigahertz");
printf("\n7. megahertz to hertz");
printf("\n8. megahertz to kilohertz");
printf("\n9. megahertz to gigahertz");
printf("\n10.gigahertz to hertz");
printf("\n11.gigahertz to kilohertz");
printf("\n12.gigahertz to megahertz");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("hertz to kilohertz\n\nhertz value :");
scanf("%f",&a);
b = a/1000;
printf("%f hertz = %f kilohertz",a,b);
}
else if(l == 2)
{
printf("hertz to megahertz\n\nhertz value :");
scanf("%f",&a);
b = a/1000000;
printf("%f hertz = %f kilohertz",a,b);
}
else if(l == 3)
{
printf("hertz to gigahertz\n\nhertz value :");
scanf("%f",&a);
b = a/1000000000;
printf("%f hertz = %f gigahertz",a,b);
}
else if(l == 4)
{
printf("kilohertz to hertz\n\nkilohertz value :");
scanf("%f",&a);
b = a*1000;
printf("%f kilohertz = %f hertz",a,b);
}
else if(l == 5)
{
printf("kilohertz to megahertz\n\nkilohertz value :");
scanf("%f",&a);
b = a/1000;
printf("%f kilohertz = %f megahertz",a,b);
}
else if(l == 6)
{
printf("kilohertz to gigahertz\n\nkilohertz value :");
scanf("%f",&a);
b = a/1000000;
printf("%f kilohertz = %f gigahertz",a,b);
}
else if(l == 7)
{
printf("megahertz to hertz\n\nmegahertz value :");
scanf("%f",&a);
b = a*1000000;
printf("%f megahertz = %f hertz",a,b);
}
else if(l == 8)
{
printf("megahertz to kilohertz\n\nmegahertz value :");
scanf("%f",&a);
b = a*1000;
printf("%f megahertz = %f kilohertz",a,b);
}
else if(l == 9)
{
printf("megahertz to gigahertz\n\nmegahertz value :");
scanf("%f",&a);
b = a/1000;
printf("%f megahertz = %f gigahertz",a,b);
}
else if(l == 10)
{
printf("gigahertz to hertz\n\ngigahertz value :");
scanf("%f",&a);
b = a*1000000000;
printf("%f gigahertz = %f hertz",a,b);
}
else if(l == 11)
{
printf("gigahertz to kilohertz\n\ngigahertz value :");
scanf("%f",&a);
b = a*1000000;
printf("%f gigahertz = %f kilohertz",a,b);
}
else if(l == 12)
{
printf("gigahertz to megahertz\n\ngigahertz value :");
scanf("%f",&a);
b = a*1000;
printf("%f gigahertz = %f megahertz",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'f':
printf("\nyou choose fuel economy conversion");
printf("\n1.kilometer per liter to liter per 100 kilometer");
printf("\n2.liter per 100 kilometer to kilometer per liter");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("kilometer per liter to liter per 100 kilomete\n\nkilometer value :");
scanf("%f",&a);
b = 100/(a/1);
printf("%f kilometer per hour = %f liter per 100 kilometer",a,b);
}
else if(l == 2)
{
printf("liter per 100 kilometer to kilometer per liter\n\nliter value :");
scanf("%f",&a);
b = 100/(a/1);
printf("%f liter per 100 kilometer = %f kilometer per liter",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'g':
printf("\nyou choose length conversion");
printf("\n1 . kilometer to meter");
printf("\n2 . kilometer to centimeter");
printf("\n3 . kilometer to millimeter");
printf("\n4 . kilometer to miles");
printf("\n5 .meter to kilometer");
printf("\n6 .meter to centimeter");
printf("\n7 .meter to millimeter");
printf("\n8 .meter to mile");
printf("\n9 .centimeter to kilometer");
printf("\n10.centimeter to meter");
printf("\n11.centimeter to millimeter");
printf("\n12.centimeter to mile");
printf("\n13.millimeter to kilometer");
printf("\n14.millimeter to meter");
printf("\n15.millimeter to centimeter");
printf("\n16.millimeter to mile");
printf("\n17.mile to kilometer");
printf("\n18.mile to meter");
printf("\n19.mile to centimeter");
printf("\n20.mile to millimeter");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{
printf("kilometer to meter\n\nkilometer value :");
scanf("%f",&a);
b = a*1000;
printf("%f kilometer = %f meter",a,b);
}
else if(l == 2)
{
printf("kilometer to centimeter\n\nkilometer value :");
scanf("%f",&a);
b = a*100000;
printf("%f kilometer = %f centimeter",a,b);
}
else if(l == 3)
{
printf("kilometer to millimeter\n\nkilometer value :");
scanf("%f",&a);
a = a*1000000;
printf("%f kilometer = %f millimeter",a,b);
}
else if(l == 4)
{
printf("kilometer to mile \n\nkilometer value :");
scanf("%f",&a);
b = a/1.609;
printf("%f kilometer = %f miles",a,b);
}
else if(l == 5)
{
printf("meter to kilometer \n\nmeter value :");
scanf("%f",&a);
b = a/1000;
printf("%f meter = %f kilometer",a,b);
}
else if(l == 6)
{
printf("meter to centimeter \n\nmeter value :");
scanf("%f",&a);
b = a*200;
printf("%f meter = %f centimeter",a,b);
}
else if(l == 7)
{
printf("meter to millimeter \n\nmeter value :");
scanf("%f",&a);
b = a*1000;
printf("%f meter = %f millimeter",a,b);
}
else if(l == 8)
{
printf("meter to mile \n\nmeter value :");
scanf("%f",&a);
b = a/1609;
printf("%f meter = %f mile",a,b);
}
else if(l == 9)
{
printf("centimeter to kilometer \n\ncentimeter value :");
scanf("%f",&a);
b = a/100000;
printf("%f centimeter = %f kilometer",a,b);
}
else if(l == 10)
{
printf("centimeter to meter \n\ncentimeter value :");
scanf("%f",&a);
b = a/100;
printf("%f centimeter = %f meter",a,b);
}
else if(l == 11)
{
printf("centimeter to millimeter \n\ncentimeter value :");
scanf("%f",&a);
b = a*10;
printf("%f centimeter = %f millimeter",a,b);
}
else if(l == 12)
{
printf("centimeter to mile\n\ncentimeter value :");
scanf("%f",&a);
b = a/160900;
printf("%f centimeter = %f mile",a,b);
}
else if(l == 13)
{
printf("millimeter to kilometer \n\nmillimeter value :");
scanf("%f",&a);
b = a/1000000;
printf("%f millimeter = %f kilometer",a,b);
}
else if(l == 14)
{
printf("millimeter to meter \n\nmillimeter value :");
scanf("%f",&a);
b = a/1000;
printf("%f millimeter = %f meter",a,b);
}
else if(l == 15)
{
printf("millimeter to centimeter \n\nmillimeter value :");
scanf("%f",&a);
b = a/10;
printf("%f millimeter = %f centimeter",a,b);
}
else if(l == 16)
{
printf("millimeter to mile \n\nmillimeter value :");
scanf("%f",&a);
b = a/1609000;
printf("%f millimeter = %f mile",a,b);
}
else if(l == 17)
{
printf("mile to kilometer \n\nmile value :");
scanf("%f",&a);
b = a*1.609;
printf("%f mile = %f kilometer",a,b);
}
else if(l == 18)
{
printf("mile to meter \n\nmile value :");
scanf("%f",&a);
b = a*1609;
printf("%f mile = %f meter",a,b);
}
else if(l == 19)
{
printf("mile to centimeter \n\nmile value :");
scanf("%f",&a);
b = a*160900;
printf("%f mile = %f centimeter",a,b);
}
else if(l == 20)
{
printf("mile to millimeter \n\nmile value :");
scanf("%f",&a);
b = a*1609000;
printf("%f mile = %f millimeter",a,b);
}
else
{
printf("Enter wrong option");
}
break;
case 'h':
printf("\nyou choose mass conversion");
printf("\n1 .tonne to kilogram");
printf("\n2 .tonne to gram");
printf("\n3 .tonne to pound");
printf("\n4 .kilogram to tonne");
printf("\n5 .kilogram to gram");
printf("\n6 .kilogram to pound");
printf("\n7 .gram to tonne");
printf("\n8 .gram to kilogram");
printf("\n9 .gram to pound");
printf("\n10.pound to tonne");
printf("\n11.pound to kilogram");
printf("\n12.pound to gram");
printf("\n\nEnter your option : ");
scanf("%d",&l);
if(l == 1)
{