+ 1
Write a C program to find biggest and bigger among 3 inputs.
4 Réponses
+ 10
get a
get b
get c
if a > b and a > c, biggest = a
if b > a and b > c, biggest = b
if c > a and c > b, biggest = c
evaluate biggest,
a : if b > c, bigger = b. else, bigger = c
if bigger == biggest, bigger = b
b : if a > c, bigger = a. else, bigger = c
if bigger == biggest, bigger = a
c : if a > b, bigger = a. else, bigger = b
if bigger == biggest, bigger = a
+ 9
Edited original answer. However, what if all your three numbers are the same? What would you want the program to do?
+ 2
but
it will fail if we input
12
12
10
or
10
9
10
+ 2
Entering these inputs results biggest 12 and bigger 12