# C Programming - Floating Point Issues - Discussion

Discussion Forum : Floating Point Issues - Find Output of Program (Q.No. 4)

4.

What will be the output of the program?

```
#include<stdio.h>
#include<math.h>
int main()
{
printf("%f\n", sqrt(36.0));
return 0;
}
```

Answer: Option

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.

Discussion:

15 comments Page 1 of 2.
Gaurav said:
1 decade ago

But sir, float has only 4 terms after decimal place and there is 6 six terms after decimal?

Ramkrishna said:
1 decade ago

6.0 is allso float right? Why can't I become a answer please explain?

Rajaasekaran said:
1 decade ago

Can you give me example program for square root of double ?

Surbhi said:
1 decade ago

Why not 6.0?

Shailesh said:
1 decade ago

Because.

36.0 is double.

6.0 is float.

So the answer 6.0 is not possible.

36.0 is double.

6.0 is float.

So the answer 6.0 is not possible.

D SURESH said:
1 decade ago

Generally float value will display like six digits after the decimal point so, output of the above program will be 6.000000 because sqrt (36.0) =6.000000.

Sankari said:
1 decade ago

36.0 is double, how it is double can anyone explain me please?

What is double and float?

What is double and float?

Nishant said:
1 decade ago

But when I tried in turbo C it return 0. Why?

Yogesh tiwari said:
1 decade ago

Sir I am not satisfied with your answer, it turbo c it create error please explain.

Meghana said:
10 years ago

Can anyone explain me how 36.0 is double?

Post your comments here:

Quick links

Quantitative Aptitude

Verbal (English)

Reasoning

Programming

Interview

Placement Papers