#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<“Enter the first number “;
cin>>a;
cout<<“Enter the second number “;
cin>>b;
cout<<“Enter the third number “;
cin>>c;
if (a>b)
{ if (a>c)
{ cout<<“a is largest number “;
}
else
{cout<<“c is largest number “;
}
}
else
{ if (b>c)
{ cout<<“b is largest number “;
}
else
{cout<<“c is largest number “;
}
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<“Enter the first number “;
cin>>a;
cout<<“Enter the second number “;
cin>>b;
cout<<“Enter the third number “;
cin>>c;
if (a>b)
{ if (a>c)
{ cout<<“a is largest number “;
}
else
{cout<<“c is largest number “;
}
}
else
{ if (b>c)
{ cout<<“b is largest number “;
}
else
{cout<<“c is largest number “;
}
}
getch();
}
No comments:
Post a Comment