Results 1 to 2 of 2
  1. #1
    sanshik is offline Member
    Join Date
    Jul 2011
    Location
    India
    Posts
    6
    Rep Power
    0

    Default exception in thread main

    D:\jp>java Prime
    Enter the range to print the prime number
    30
    Exception in thread "main" java.lang.ArithmeticException: / by zero
    at Prime.main(Prime.java:16)

    this is the error i got when i have executed the file .
    pl.suggest me a solution
    thanks in advance

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,788
    Rep Power
    7

    Default

    Quote Originally Posted by sanshik View Post
    Exception in thread "main" java.lang.ArithmeticException: / by zero
    That is divide by zero if you didn't know or didn't you bother to read the error message.
    pl.suggest me a solution
    Simple! Stop dividing by zero. It is mathematically impossible.

Similar Threads

  1. Exception in thread main
    By miss_peaches in forum New To Java
    Replies: 2
    Last Post: 04-30-2011, 04:20 AM
  2. Exception in thread main
    By maya700 in forum New To Java
    Replies: 14
    Last Post: 06-27-2010, 07:59 PM
  3. Replies: 6
    Last Post: 07-16-2009, 03:30 PM
  4. Replies: 1
    Last Post: 07-16-2009, 10:35 AM
  5. Replies: 1
    Last Post: 08-07-2007, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •