Discussion Forums

New User? Please read instructions!

C program to find smallest of given 3 numbers  

  RSS

thiyagarajan
Eminent Member
Joined: 5 months  ago
Posts: 26
27/01/2017 9:30 am  

C program to find smallest of given 3 numbers


ReplyQuote
admin
Eminent Member
Joined: 5 years  ago
Posts: 26
31/01/2017 10:31 am  

Please use below C program to find smallest of given 3 numbers.

#include <stdio.h>

int main()

{

      float a, b, c;

      printf("\nPlease enter 3 numbers: ");

      scanf("%f %f %f", &a, &b, &c);

      if(a<=b && a<=c)

         printf("The smallest number is %.3f", a);

      if(b<=a && b<=c)

         printf("The smallest number is %.3f", b);

      if(c<=a && c<=b)

         printf("The smallest number is %.3f", c);

      return 0;

}

Edited: 5 months  ago

ReplyQuote
  
Working

Please Login or Register

Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!