C Program to find smallest number among three numbers


In this program, You will learn how to find smallest number among three numbers in C.


10 20 30 => 10

40 50 30 => 30


Example: How to find smallest number among three numbers in C

Run it Now
#include<stdio.h>

int main() {

   int a, b, c;
   
   printf("Enter Three numbers :");
   scanf("%d%d%d", &a, &b, &c);

   if (a < b && a < c) {
       printf("\nSmallest is :%d", a);
   } else if (b < c) {
       printf("\nSmallest is :%d", b);
   } else {
       printf("\nSmallest is :%d", c);
   }

   return 0;
}

Output:

Enter Three numbers :10 20 30
Smallest is :10