Tuesday, December 24, 2013

Program to find the largest of three numbers

Source Code:
#include<conio.h>
#include<stdio.h>
int main()
{int a=0,b=0,c=0;
printf("\n enter the numbers:");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(b>c)
 printf("\n %d is largest:",a);
 else
 printf("\n %d is largest:",c);
}
else if(b>c)
printf("\n %d is largest:",b);
else
printf("\n %d is largest:",c);
getch();
return 0;
}

No comments:

Post a Comment