I just wrote a simple program to calculate Square root of a number, But when I try to compile it, I get this Error :
/tmp/ccmo2eCt.o: In function `main': test01.c:(.text+0x59): undefined reference to `sqrt' collect2: ld returned 1 exit status
Tha's the source Code :
/* Test1 : Test1.c
This program calculate root of the numbers */
#include <stdio.h>
#include <math.h>
int main()
{
int c1;
printf( "Enter your number\n" );
scanf( "%d", &c1 );
printf( "%.2f", sqrt( c1 ) );
return 0;
}
Could anybody help me?


Sign In
Create Account

Back to top









