EmbLogic's Blog

addition of distance in feet and inches

1 head    2.1;
2 access;
3 symbols;
4 locks
5         emblogic:1.1; strict;
6 comment @ * @;
7
8
9 1.1
10 date    2015.02.21.05.39.49;    author emblogic;        state Exp;
11 branches;
12 next    ;
13
14
15 desc
16 @This programme will calculate the distance in feet and inches
17 @
18
19
20 1.1
21 log
22 @Initial revision
23 @
24 text
25 @#include<stdio.h>
26 int main()
27 {
28         float  feet, inch,feet1,feet2,inch1,inch2;
29         printf(“enter 1st distance in feet\n”);
30         scanf(“%f”, &feet1);
31         printf(“enter 1st distance in inches\n”);
32         scanf(“%f”, &inch1);
33         printf(“enter 2nd distance in feet\n”);
34         scanf(“%f”, &feet2);
35         printf(“enter 2nd distance in inches\n”);
36         scanf(“%f”, &inch2);
37         feet= feet1 + feet2;
38         inch=inch1 + inch2;
39         if (inch > 12)
40         {
41         inch=inch – 12;
42         feet++;
43         printf(“%4.2f\n”, feet);
44         printf(“%4.2f\n”, inch);
45         }
46         return 0;
47         }
48 @
~
– INSERT –                                                                                                                                                                  1,7-10        All

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>