• Language

    C

  • Description

    It reads values into A, B, and C, and it divides the larger by the smaller.

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
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
    float A, B, C, larger, result;
    float smaller;
    printf ("Enter the value of A: ");
    scanf ("%f", &A);
    (void) getchar ();
    printf ("Enter the value of B: ");
    scanf ("%f", &B);
    (void) getchar ();
    printf ("Enter the value of C: ");
    scanf ("%f", &C);
    (void) getchar ();
    if(A>B)
    {
        larger=A;
        smaller=B;
    }
    else
    {
        larger=B;
        smaller=A;
    }
    if(larger<C)
        larger=C;
    if(smaller>C)
        smaller=C;
    result=larger/smaller;
    printf ("Value of larger: %g\n", larger);
    printf ("Value of result: %g\n", result);
    printf ("Value of smaller: %g\n", smaller);
    putchar ('\n');
    system ("pause");
    return EXIT_SUCCESS;
}