Saturday, 4 October 2014

program in java to display the name of player who played highest matches designed by pratik




class players
{
public static void main(String args[])
{
String n1,n2,n3,n4;
int m1,m2,m3,m4;
n1="Pratik";
m1=11;
n2="Savita";
m2=36;
n3="Abhishek";
m3=40;
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
if(m1>m2 && m1>m3)
{
System.out.print("\n\n\t\tName is = "+n1);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
System.out.print("\n\n\t\tMatches Played = "+m1);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
}
if(m2>m3 && m2>m1)
{
System.out.print("\n\n\t\tName is = "+n2);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
System.out.print("\n\n\t\tMatches Played = "+m2);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
}
if(m3>m1 && m3>m2)
{
System.out.print("\n\n\t\tName is = "+n3);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
System.out.print("\n\n\t\tMatches Played = "+m3);
System.out.print("\n\n\t\t~~~~~~~~~~~~~~~~~~~~");
}
}
}

OUTPUT : -





No comments:

Post a Comment