Friday, January 23, 2015

Flip.java in pgm



Flip.java

public class Flip 
{
              public static void main(String[] args)
{ 
        if (Math.random() < 0.5) 
        System.out.println("Heads");
        else                     
        System.out.println("Tails");
    }
}

No comments:

Post a Comment