#include<stdio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter three values\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(c>a)
{
printf("%d is 2nd largest",a);
}
else
{
if(b>c)
{
printf("%d is 2nd largest",b);
}
else
{
printf("%d is 2nd largest",c);
}
}
}
else
{
if(c>b)
{
printf("%d is 2nd largest",b);
}
else
{
printf("%d is 2nd largest",c);
}
}
getch();
}
void main()
{
int a,b,c;
clrscr();
printf("Enter three values\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(c>a)
{
printf("%d is 2nd largest",a);
}
else
{
if(b>c)
{
printf("%d is 2nd largest",b);
}
else
{
printf("%d is 2nd largest",c);
}
}
}
else
{
if(c>b)
{
printf("%d is 2nd largest",b);
}
else
{
printf("%d is 2nd largest",c);
}
}
getch();
}
No comments:
Post a Comment