Standard Libraries: Example
#include <stdio.h>
/* #include <math.h> */
int main( void )
{
printf( “Square root of 2 is %f\n”, sqrt(2) );
return( 0 );
}
May get various problems/errors when you compile with:
1) gcc example.c -o example
2) gcc example.c -m -o example
3) gcc example.c -m -o example # with math.h included
Previous slide
Next slide
Back to first slide
View graphic version