C Programming Code Examples C > If Else and Switch Case Code Examples Compare Three integers in C Compare Three integers in C Comparing three integer variables is one of the simplest program you can write at ease. In this program, you can either take input from user using scanf() function or statically define in the program itself. We expect it to be a simple program for you as well. We compare one value to rest of two and check the result and the same process is applied for all variables. For this program, all values should be distinct (unique). #include <stdio.h> int main() { int a, b, c; a = 13; b = 23; c = 36; if ( a > b && a > c ) printf("%d is the largest.", a); else if ( b > a && b > c ) printf("%d is the largest.", b); else if ( c > a && c > b ) printf("%d is the largest.", c); else printf("Values are not unique"); return 0; } procedure compare(A, B, C) IF A is greater than B AND A is greater than C DISPLAY "A is the largest." ELSE IF B is greater than A AND A is greater than C DISPLAY "B is the largest." ELSE IF C is greater than A AND A is greater than B DISPLAY "C is the largest." ELSE DISPLAY "Values not unique." END IF end procedure