From 8edd4c4b1d33c05e9c88fc04549bb10ffd682b7f Mon Sep 17 00:00:00 2001 From: Ritwik Singh <46321538+ritwiksingh21@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:01:26 +0530 Subject: [PATCH] Solution to Three Friends --- Three Friends/Solution Three Friends in C | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Three Friends/Solution Three Friends in C diff --git a/Three Friends/Solution Three Friends in C b/Three Friends/Solution Three Friends in C new file mode 100644 index 0000000..433775b --- /dev/null +++ b/Three Friends/Solution Three Friends in C @@ -0,0 +1,33 @@ +#include +int cal(int a,int b,int c){ + return abs(a - b) + abs(a - c) + abs(b - c); +} +int min(int a, int b){ + int mini; + if(a == b){return a;} + else{ + mini = a