Thread: Division Question

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    9

    Division Question

    Hi,

    Can a number be divided by 0 and can 0 be divided ?

    I'm new to programming and i encountered this question where the above situation occur. What should i do?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    A number cannot be divided by zero (you'll get an error), but zero can be divided (with a consistent result of zero).
    My best code is written with the delete key.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by meandmyipod View Post
    Hi,

    Can a number be divided by 0 and can 0 be divided ?

    I'm new to programming and i encountered this question where the above situation occur. What should i do?
    As prelude points out... any number divided by 0 is infinity... on windows you will get an exception and the program will exit.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question About Binary Division
    By nirvana21 in forum Tech Board
    Replies: 3
    Last Post: 02-13-2009, 04:20 PM
  2. Mod Division Question
    By GCNDoug in forum C Programming
    Replies: 3
    Last Post: 04-05-2007, 05:14 PM
  3. Division by 0
    By ajaxthegreater in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-08-2005, 04:21 PM
  4. modulo 2 division question help
    By shaq8u in forum C Programming
    Replies: 9
    Last Post: 08-20-2003, 08:37 AM
  5. C++ Simple division question - i hope
    By learning110 in forum C++ Programming
    Replies: 6
    Last Post: 03-20-2003, 06:37 PM