Codex

Toss

Jul 1st, 2011
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. /* This program works like tossing a coin and gives randomly head or tails*/
  2. class Toss
  3. {
  4. public static void main(String args[])
  5. {
  6. int random=(int)(Math.random()*100);
  7. if((random%2)==0)
  8. System.out.println("Head");
  9. else
  10. System.out.println("Tails");
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment