From ba24149dd0ba6807d916ca231f6ce5078a64d09e Mon Sep 17 00:00:00 2001 From: toshishir <48086896+toshishir@users.noreply.github.com> Date: Sat, 3 Oct 2020 18:18:45 +0530 Subject: [PATCH] greater --- greater | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 greater diff --git a/greater b/greater new file mode 100644 index 0000000..7b9bc94 --- /dev/null +++ b/greater @@ -0,0 +1,25 @@ +#include + +void main() +{ + int num1, num2, num3; + + printf("Enter the values of num1, num2 and num3\n"); + scanf("%d %d %d", &num1, &num2, &num3); + printf("num1 = %d\tnum2 = %d\tnum3 = %d\n", num1, num2, num3); + if (num1 > num2) + { + if (num1 > num3) + { + printf("num1 is the greatest among three \n"); + } + else + { + printf("num3 is the greatest among three \n"); + } + } + else if (num2 > num3) + printf("num2 is the greatest among three \n"); + else + printf("num3 is the greatest among three \n"); +}