I am using gcc compiler Below is the program: 4. void main() 5. { 6. clrscr(); 7. char z = 'y'; 8. double x; 9. do 10. { 11. printf("\nGive positive number "); 12. scanf("%lf",&x); 13. if (x<0) 14. {printf("\n wrong number \n"); 15. continue; 16. } 17. printf("The square root = %lf \n\n",sqrt(x)); 18. printf("Do you like to continue(y/n) "); 19. z = getche(); 20. }
21. while (z == 'y'); 22. getch(); 23. } It doesn't work even if I remove conio.h and clrscr(). The report is: undefined reference to 'sqrt' -- Summary: undefined reference to 'sqrt' Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: msborowi at cyf-kr dot edu dot pl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27259