Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Calculer la racine carrée des valeurs d’un tableau

 calcul
{filelink=13547}

#include <stdio.h>
#include
<math.h>
 
int main( )
{
 
	double x[ ] = { 0.5, 0.0, 2.0, 8.0, -0.0, -0.5 };
 
for ( int i = 0; i < ( sizeof(x) / sizeof(double) ); i++)
{
  printf("Racine carrée de %.2F = %.4Fn", x[i], sqrt( x[i] ) );
  if ( errno )
    perror( __FILE__ );
}
 
return 0;
 
}

No comments yet.

Leave a Comment