Exponentiation in C language

Solved/Closed
andro127 -  
 Anonyme -
Hello, I regularly face a problem:
I can't assign to a variable a power of two other variables!
int a;
a=q^z;
doesn't work.
int a;
a=qez;
doesn't work either.
Does anyone know how to do this or should I resort to differentiating the cases where z=1, z=2, etc...?
Thanks in advance.
@+

2 answers

  1. aelmkies
     
    If you include math.h (the library of mathematical functions), you have access to the function

    pow(a,b) 

    which calculates a raised to the power of b.
    200
    1. andro127
       
      thank you very much, honestly thank you*
      you are helping me out of a tough spot..
      see you later
      0
    2. Anonyme
       
      Simple and quick, thank you!!
      0