Choose a job you love, and you will never have to work a day in your life.- Confucius
 News Tutorials Code Samples Blogs Forums

 Forum Index » C and C++ » Viewing Topic and Replies

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

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

Viewed: 6,515 Times | |
bs0d
 Subject: "re: Small Calculator !!" Posted: @ 10:24 pm on Jan 08 2008

Member #: 1
Since: 02/06/05
Posts: 602
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: 6,498 Times | |
Viewing Page: 1 of 1

 1 |

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