Skip to content

p022.c

Problem Statement

WAP to find out smallest of three numbers without using if_else block.

Metadata

Property Detail
Author Amit Dutta (amitdutta4255@gmail.com)
License MIT

Actions

Raw View on GitHub

💡 You can print or save this file by opening Raw and using your browser.

Source Code

#include <stdio.h>
int main()
{
    int a, b, c, min;
    printf("Enter three number : ");
    scanf("%d %d %d", &a, &b, &c);
    min = (a < b && a < c) ? a : (b < a && b < c) ? b
                                                  : c;
    printf("Minimum = %d", min);
    return 0;
}