Saturday, October 12, 2013

Program to find the largest of three numbers using Logical AND (&&)


#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 && a> c)
     printf("\n %d is largest:",a);

 
else if ( b>a && b> c)
     printf("\n %d is largest:",b);


else
     printf("\n %d is largest:",c);


getch();
return 0;



No comments:

Post a Comment