Home » C Programming » Floating Point Issues

What will be the output of the program? #include #include int main() { printf("%f\n", sqrt(36.0)); return 0; }

Correct Answer: 6.000000

Explanation:

printf("%f\n", sqrt(36.0)); It prints the square root of 36 in the float format(i.e 6.000000).


Declaration Syntax: double sqrt(double x) calculates and return the positive square root of the given number.


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion