Computer Science, asked by LoganDRavager7994, 1 year ago

Write a program that generates the following output
5
10
9
Assign value 5 to a variable using =operator (=). Multiply it with 2 to generate 10 and substract 1 to generate 9

Answers

Answered by Harshit009
0

public class a

{

public static void main(String[]args)

{

int x = 5;

int y = x*2;

int z = y - 1;

System.out.println(x);

System.out.println(y);

System.out.println(z);

}

}

//Java Program...

Similar questions