A simple program to check the greatest and smallest number and display the same as output. This can also be implemented in a more efficient way using Sorting algorithms.
Language : C
[sourcecode language='c']
#include
#include
void main()
{ int a, b,c;
printf(“Enter the value for A: “);
scanf(“%d”, &a);
printf(“Enter the value for B: “);
scanf(“%d”, &b);
printf(“Enter the value for C: “);
scanf(“%d”, &c);
if((a>b)&&(a>c)
printf(“Largest is A!”);
if else ((b>a)&&(b>c))
printf(“Largest is B!”);
else
printf(“Largest is C”(;
getch();
}
[/sourcecode]







{ 1 comment… read it below or add one }
can we found the greatest and smallest number among three inputed number at a time