What is the output of the following program segment?
main ()
{
floata,b,c,X,Y,Z;
a=9;b=12;c=3;
X=a−b/3+c∗2−1
Y=a−b/(3+c)∗(2−1)
Z=a−(b/(3+c)∗2)−1
printf("X=%f╲nY=%f╲nZ=%Y",X,Y,Z);
}
main()
{
float a,b,c,X,Y,Z;
a=9;b=12;c=3;
X=a−b/3+c∗2−1
Y=a−b/(3+c)∗(2−1)
Z=a−(b/(3+c)∗2)−1
printf("X=%f╲nY=%f╲nZ=%Y",X,Y,Z);
}
A float is a term is used in various programming languages to define a variable with a fractional value. Numbers created using a float variable declaration will have digits on both sides of a decimal point. This is in contrast to the integer data type, which houses an integer or whole number.
X=9-12/3+3*2-1=10
Y=9-12/ (3+3)*(2-1) =7
Z=9-(12/ (3+3)*2)-1=4
Output:-
X=10.000000 ,Y=7.000000, Z=4.000000.