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



#include <stdio.h>
int main()
{
    int a, b;
    printf("Enter two integers to find smallest...\n");
    printf("Enter first integer : ");
    scanf("%d", &a);
    printf("Enter second integer : ");
    scanf("%d", &b);
    printf("You entered : %d and %d \n", a, b);
    if (a > b)
    {
        printf("%d is smaller \n", b);
    }
    else if (a < b)
    {
        printf("%d is smaller \n", a);
    }
    //that means both are equal
    else
    {
        printf("both are equal \n");
    }
    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