[Solved] Taking power with loop(with-out pow() function) [closed]
Here is a way you could achieve your purpose. int num = 2; // for example int out = 1; for (int exp = 1; exp <= 10; exp++) { out *= num; printf(“%d\n”, out); } Remarks about your code: Your inner while loop is infinite if num and expnt are both different from 0. … Read more