C/C++: calculer la puissance d’une valeur

Author:

 calcul
{filelink=14011}

#include

#include 

int main(void)
{
  double x = 10.0, y = 1.0;

  do {
    printf("%.2f ^ %.2f= %.2fn", x, y, pow(x, y));
    y++;
  } while(y<11.0);

  return 0;
}

/*

10.00 ^ 1.00= 10.00
10.00 ^ 2.00= 100.00
10.00 ^ 3.00= 1000.00
10.00 ^ 4.00= 10000.00
10.00 ^ 5.00= 100000.00
10.00 ^ 6.00= 1000000.00
10.00 ^ 7.00= 10000000.00
10.00 ^ 8.00= 100000000.00
10.00 ^ 9.00= 1000000000.00
10.00 ^ 10.00= 10000000000.00

  */

Leave a Reply

Your email address will not be published. Required fields are marked *