Computer Science, asked by kashyapvansh899, 4 months ago

Find the output of following program segment:-

int num=564,a;

while(num>0)

{a=num%10;

num/=10;

}

System.out.print(a);​

Answers

Answered by umeshnirmal04
3

Answer:

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.

Similar questions