सी स्रोत कोड/टर्नरी (सशर्त) ऑपरेटर का उपयोग कर तीन नंबर में से सबसे छोटी संख्या ज्ञात करना

/* To find the minimum of three numbers using the conditional operator */
#include <stdio.h>

int main(void)
{
    int a, b, c, temp, min;

    printf ("Enter three nos. separated by spaces: ");
    scanf ("%d%d%d", &a, &b, &c);

    temp = (a < b)    ? a : b;
    min =  (c < temp) ? c : temp;

    printf ("The Minimum of the three is: %d", min);

    /* indicate success */
    return 0;
}
/* Output:

 Enter three nos. separated by spaces: 2 5 9
 The Minimum of the three is: 2

*/