Discussion Forums

New User? Please read instructions!

C program to find largest of given 3 numbers  

  RSS

thiyagarajan
Eminent Member
Joined: 1 month  ago
Posts: 26
27/01/2017 9:29 am  

Need C program to find largest of given 3 numbers


ReplyQuote
prakash
Eminent Member
Joined: 1 month  ago
Posts: 20
30/01/2017 10:27 am  

Hi, To find largest of given 3 numbers, please use below C program.

 

#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("\nThe largest number is %f", a);

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

         printf("\nThe largest number is %f", b);

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

         printf("\nThe largest number is %f", c);

      return 0;

}

Edited: 4 weeks  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!