C Program to Find Largest from Three Numbers

#include<stdio.h>
#include<conio.h>

int main()
{
	 float a,b,c,lg;
	 clrscr();
	 printf("Enter three numbers:\n");
	 scanf("%f%f%f",&a,&b,&c);
	 lg = a;
	 
	 if(b>lg)
	 {
	  lg = b;
	 }
	 
	 if(c>lg)
	 {
	  lg = c;
	 }
	 
	 printf("Largest = %0.2f", lg);
	 getch();
	 
	 return(0);
}

Output

Run 1:
------------
Enter thre numbers:
56 ↲
78 ↲
67 ↲
Largest = 78.00

Run 2:
------------
Enter thre numbers:
-89 ↲
-78 ↲
-67 ↲
Largest = -67.00

Leave a Reply

Your email address will not be published. Required fields are marked *

https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
About
Products
Subscribe

If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

    Applauz

    As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

    Subscribe

    If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

      Applauz

      As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

      Copyright by BOLD THEMES. All rights reserved.