/*program to find largest number from three given numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,larger;
clrscr();
printf("Enter three numbers :\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(a>c)
larger=a;
else
larger=c;
}
else
{
if(b>c)
larger=b;
else
larger=c;
}
printf("Larger number is %d ",larger);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,larger;
clrscr();
printf("Enter three numbers :\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(a>c)
larger=a;
else
larger=c;
}
else
{
if(b>c)
larger=b;
else
larger=c;
}
printf("Larger number is %d ",larger);
getch();
}
No comments:
Post a Comment