+ Reply to Thread
Results 1 to 2 of 2

Thread: Divide two numbers without using division operator

  1. #1
    Krazy Guest

    Divide two numbers without using division operator

    Write function to divide two numbers wihtout using division operator

  2. #2
    AkkiS Guest
    Let the two numbers be 'a' and 'b' and we want to find a/b
    Code:
    int quotient(int a,int b){
      int t = 1 ;
      while(b*t <= a){
         t++;
      }
      return t -1 ;
    }
    Last edited by AkkiS; 18th November 2010 at 00:16.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How will you divide 100 coins
    By admin in forum Adobe
    Replies: 2
    Last Post: 29th February 2012, 02:12
  2. assingment operator parameters
    By JavaGuy in forum C++ Fundamentals
    Replies: 0
    Last Post: 20th June 2010, 13:29
  3. Overloaded new operator
    By JavaGuy in forum C++ Fundamentals
    Replies: 0
    Last Post: 20th June 2010, 13:13
  4. overloaded new operator
    By Surfer in forum Bloomberg
    Replies: 0
    Last Post: 26th May 2010, 23:43
  5. Replies: 0
    Last Post: 24th March 2010, 14:12

Tags for this Thread

Bookmarks

Posting Permissions

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