Finding Smallest of Three Numbers
In this, we are going to write a program to find smallest of three numbers in C Programming.



#include <stdio.h>
int main()
{
    int a, b, c;
    printf("Enter three integers to find smallest...\n");
    printf("Enter first integer : \n");
    scanf("%d", &a);
    printf("Enter second integer : \n");
    scanf("%d", &b);
    printf("Enter third integer : \n");
    scanf("%d", &c);
    printf("You entered : %d %d %d \n", a, b, c);
    if (a <= b && a <= c)
    {
        printf("%d is the smallest number.", a);
    }

    else if (b <= a && b <= c)
    {
        printf("%d is the smallest number.", b);
    }

    else if (c <= a && c <= b)
    {
        printf("%d is the smallest number.", c);
    }

    return 0;
}
//.........Coded By ARADHANA MISHRA

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post