Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:22:21+00:00 2026-05-30T23:22:21+00:00

Hey so I’m making a factoring program and I’m wondering if anyone can give

  • 0

Hey so I’m making a factoring program and I’m wondering if anyone can give me any ideas on an efficient way to find what two numbers multiple to a specified number, and also add to a specified number.

for example I may have

(a)(b) = 6

a + b = 5

So essentially i just need a way to find the a and b values. In this case they would be 2 and 3.

Can anyone give me any ideas on where to start? Negative numbers must also be considered for use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:22:23+00:00Added an answer on May 30, 2026 at 11:22 pm

    There is no need to loop, just use simple math to solve this equation system:

    a*b = i;

    a+b = j;

    a = j/b;

    a = i-b;

    j/b = i-b; so:

    b + j/b + i = 0

    b^2 + i*b + j = 0

    From here, its a quadratic equation, and it’s trivial to find b (just implement the quadratic equation formula) and from there get the value for a.

    There you go:

    function finder($add,$product)
    {
    
     $inside_root = $add*$add - 4*$product;
    
     if($inside_root >=0)
     {
    
         $b = ($add + sqrt($inside_root))/2;
         $a = $add - $b;
    
         echo "$a+$b = $add and $a*$b=$product\n";
    
     }else
     {
       echo "No real solution\n";
     }
    }
    

    Real live action:

    http://codepad.org/JBxMgHBd

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey so I'm wondering how can I make AtomicInteger a two dimensional array, From
Hey i have been looking around and i cant find a way to get
Hey all, just wondering what the best way to add this capability was. I
Hey, I'm looking to find a good MySQL framework for Cocoa that I can
Hey I've been struggling with this whole day, and I can't find the answer
Hey all i am wondering why my code below is only writing the first
* *Hey i was working on an application which converts any basenumber like (2,8,10,16,etc)
Hey, I have a question regarding code structure, and was wondering what the best
Hey, I want to know how to connect databases with C++? Any cross-platform solution
Hey Folks i am trying to compile this C++ program: #include <stdio.h> #include <string.h>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.