Search
Left Quote    Maybe this world is another planet's Hell.
- Aldous Huxley    
Right Quote
 
[login] | [Register]
Forum Index » C and C++ » Viewing Topic and Replies
Post Reply


        Viewing Topic: Small Calculator !!
  This user is offline  Smart
  Subject: "Small Calculator !!" Posted: @ 11:17 am on Jan 08 2008   
Member #: 535
Rank: User - (3)
Since: 01/08/08
Posts: 2

Could you please help me with the piece of code that makes this equation :

2 inputs

First is a number , second is a number also more over this second input is a percent to be calculated from the firt input and in the result should be the first input plus the percent calculated !!

Example

100 | 10
result = 110

Thanks in advance


    Viewed: 4,979 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Small Calculator !!" Posted: @ 10:24 pm on Jan 08 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

I believe your formula would look like this:

$ans = (($num2 / 100) * $num1) + $num1;

You can open Excel and give it a shot to see if that's what you mean. If you were to have the formula in Excel in cell A3 referencing to A1 and num1 and A2 as num2, the formula would look like this:

=((A2/100) * A1) + A1




-bs0d | AllSyntax.com

    Viewed: 4,962 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank