1) Write a loop to multiply "x" by itself, "n" times.
2) Use recursion. If your function is called "myPower", then if the exponent is 1, return "x". Otherwise return myPower(x, n - 1).
3) But in general, and especially if you want to calculate non-integral powers, it's best to use the functions already included in the C language.
cn = c0 *( 1 + i ) pow n
There is a function called pow in header math.h
a c program for creat a virus
int pow (int a, int b) { if (b==0) return 1; else return a*pow(a,b-1); }
Into the source program.
Write a c program to compute the surface area and volume of a cube
There is no need to write a C program for circuit analysis; there are lots of packages out there that already do that (for example, Spice).
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
There is a function which can do it for you. You have to include math.h in headers. And then use the function pow(x, y) which returns a value of type double (x and y are double too).pow(x, y) = x to the power of y.
For first find an example program.
Use a text-editor program.
c#