-2

So, I have two numbers, lets say I have 97 and 32.

I need to get 97% of 32, which would be 31.04.

In code, I have these variables

int amountFree = 32;
int percentToGet = 97;

What would be the formula to calculate a specific percent of a specific number?

It's not as simple as that though as I wont always know the values.

xozijow
  • 91
  • 1
  • 1
  • 4

1 Answers1

0

Try This-

     static void Main(string[] args)
        {
            double original = 32;
            double percentOf = 97;

            double total = original * percentOf / 100;

            Console.WriteLine(total);
        }

I'm assuming this is a console application but the formula should be the same for the calculation you need.

Krazy Dev
  • 184
  • 3
  • 16