0

so the snippet of code is me trying to increase a number by a percentage and I can't work out what I have done wrong as it keeps just giving me the number I'm trying to increase back. I am very new to programming in c# so please don't have a go at me but some help would be appreciated. (piNo stands for percentage increase by the way)

Console.WriteLine("Enter the number you want to increase");
            int piNo_1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("enter the percentage you want to increase by");
            int piNo_2 = Convert.ToInt32(Console.ReadLine());
            int calc_1;

            calc_1 = piNo_2 + 100;

            int calc_2 = calc_1 / 100;

            int ans = calc_2 * piNo_1;

            Console.WriteLine(ans);
            Console.ReadLine();
Casper Powell
  • 41
  • 1
  • 1
  • 3

0 Answers0