Hey guys, this is a realy simple question (I think). So I'm supposed to write a function that elevates a number to some other number (function inputs). Here it is as presented in the solution:
The only question that I have is, if n=0 the output is 1 (as it should be!). Where in this code does that happen?Code:float pot(float x, int n){ float res; int i; for(i=1, res=1.0; i<=n; i++) res*=x; return res; }