Sunday 20 October 2013

Largest among three number in C

#include<stdio.h>
#include<conio.h>
void main()
{
int a, b, c;
printf("Enter three numbers: ");
scanf("%d %d %d", &a, &b, &c);
if (a>=b)
{
if(a>=c)
printf("Largest number = %d",a);
else
printf("Largest number = %d",c);
}
else
{
if(b>=c)
printf("Largest number = %d",b);
else
printf("Largest number = %d",c);
}
getch();
     }

No comments :

Post a Comment