From 138e8b1093caea34597aa78152b8a86bcb9d468f Mon Sep 17 00:00:00 2001 From: Sidddharthh <56505365+Sidddharthh@users.noreply.github.com> Date: Thu, 31 Oct 2019 05:31:20 +0530 Subject: [PATCH] to find the greatest number out of 3 numbers --- greatest_in_3_numbers.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 greatest_in_3_numbers.c diff --git a/greatest_in_3_numbers.c b/greatest_in_3_numbers.c new file mode 100644 index 0000000..639b426 --- /dev/null +++ b/greatest_in_3_numbers.c @@ -0,0 +1,19 @@ +#include + +int main() { + int a, b, c; + + printf("\n enter value of a, b & c : "); + scanf("%d %d %d", &a, &b, &c); + + if ((a > b) && (a > c)) + printf("\n a is greatest"); + + if ((b > c) && (b > a)) + printf("\n b is greatest"); + + if ((c > a) && (c > b)) + printf("\n c is greatest"); + + return 0 ; +}