Number of chocolates left after k iterations | C # program to find remaining chocolates after k iterations ; Function to find the chocolates left ; Driver code
using System ; class GFG { static int results ( int n , int k ) { return ( int ) Math . Round ( Math . Pow ( n , ( 1.0 / Math . Pow ( 2.0 , k ) ) ) ) ; } public static void Main ( ) { int k = 3 , n = 100000000 ; Console . Write ( " Chocolates ▁ left ▁ after ▁ " + k + " ▁ iterations ▁ are ▁ " + results ( n , k ) ) ; } }