+ 1

Write a C program to find biggest and bigger among 3 inputs.

21st Jul 2017, 11:01 AM
Abhishek Gunjan
Abhishek Gunjan - avatar
4 Respostas
+ 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
21st Jul 2017, 11:10 AM
Hatsy Rei
Hatsy Rei - avatar
+ 9
Edited original answer. However, what if all your three numbers are the same? What would you want the program to do?
21st Jul 2017, 11:21 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
but it will fail if we input 12 12 10 or 10 9 10
21st Jul 2017, 11:13 AM
Abhishek Gunjan
Abhishek Gunjan - avatar
+ 2
Entering these inputs results biggest 12 and bigger 12
21st Jul 2017, 11:14 AM
Abhishek Gunjan
Abhishek Gunjan - avatar