Computer Science, asked by crystalfernades, 2 months ago

What will be the output of the following program segment?

int temp = 1;
for (int i = 1; i <= 5; i++)
{

for (int j = 1; j <= i; j++)
{
System.out.print(temp + " ");

temp++;
}

System.out.println();
}

Answers

Answered by Anonymous
0

Explanation:

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.


crystalfernades: ??
Similar questions