Sunday, 5 October 2014

java program to display the name of company having more employees. Consider 4 Companies




class emp
{
public static void main(String args[])
{
String n1,n2,n3,n4;
int e1,e2,e3,e4;
n1="Nokia";
e1=2000;
n2="Samsung";
e2=20000;
n3="Micromax";
e3=4000;
n4="Micromax";
e4=50000;
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~~”);
System.out.print("\n\n\t\tThe Company having more Emplyees");
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~~~”);
if(e1>e2 && e1>e3 && e1>e4)
{
System.out.print("\n\n\t\tName of Company = "+n1);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~”);
System.out.print("\n\n\t\tTotal Employees = "+e1);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~”);
}
if(e2>e3 && e2>e1 && e2>e4)
{
System.out.print("\n\n\t\tName of Company = "+n2);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~”);
System.out.print("\n\n\t\tTotal Employees = "+e2);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~”);
}
if(e3>e1 && e3>e2 && e3>e4)
{
System.out.print("\n\n\t\tName of Company = "+n3);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~”);
System.out.print("\n\n\t\tTotal Employees = "+e3);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~~”);
}
if(e4>e1 && e4>e2 && e4>e3)
{
System.out.print("\n\n\t\tName of Company = "+n4);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~~”);
System.out.print("\n\n\t\tTotal Employees = "+e4);
System.out.print(“\n\n\t\t~~~~~~~~~~~~~~~~~~~~~”);
}
}
}

OUTPTUT : -



No comments:

Post a Comment