Headlines
Loading...
C Program to find largest and smallest value from three numbers

C Program to find largest and smallest value from three numbers

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

clrscr();

printf("\nEnter the numbers:");

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

if(a>b && a>c)

printf("\nLargest value: %d",a);

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

printf("\nLargest value: %d",b);

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

printf("\nLargest value: %d",c);

 

if(a<b && a<c)

printf("\nSmallest value: %d",a);

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

printf("\nSmallest value: %d",b);

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

printf("\nSmallest value: %d",c);

getch();

}

 

/************OUTPUT**********

 

Enter the numbers:

65

85

25

 

Largest value: 85

Smallest value: 25           */


*** PLEASE checkout the Best deals from for top sites like Amazon, Flipkart etc ***