When we will compile a c program in Linux GCC compiler we may get error message:
undefined reference to `sqrt' collect2: ld returned 1 exit status
Cause of this error is by default math.h library has not included.
Solution:
Compile the c code in the following way:
[root@localhost ~]# gcc abc.c -lm
Note: Here abc.c is name of any c code file.
C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment