Output: int x=1; do { System.out.print(x+":"); ++x;}while(x++<=5);
Answers
Answer:
Import java.util.*;
public class xyz
{
public static void main()
{
Scanner sc= new scanner ( System.in);
int z= sc.nextInt();
int x=sc.nextInt();
int y=sc.nextInt();
z= (5*x*x*x+2*y)/(x+y);
System.out.println(“the required expression is”+z);
}
}
You can input data members via Buffer also
You can take the data type as Double also.
742 viewsView 1 Upvoter
Related Questions
How do I write Java program to find the sum of following series? 1+(1+2) + (1+2+3) +… (1+2+3+…n).
6,912 Views
How would one explain ++x and x++ in this Java program?
12,336 Views
Does the Fibonacci series start with 0 or with 1?
9,912 Views
What is the output of x=5; z=++x+++x?
8,857 Views
What is the difference between ++x and x++ in C programming?
60,110 Views
What does x=x+1 mean in C programming?
3,498 Views
What is the method in Java in which if we give -1 it gives 1 if we give 1 it gives -1 without checking any condition?
570 Views
In the expression x=5; does y=x++ + ++x?
3,557 Views
If x=3, what will be the solution of x=++x+(++x) and how?
9,903 Views
What is the series 1/2+1/3+1/5+1/7+1/11-----+1/29 in Java?
9 Views
What is the difference between if n % I and if n % I == 0 in Python?
6,220 Views
What are the disadvanges and advantages of linear search?
1,421 Views
How do I calculate the square root of a number in C# using system.math?
55,493 Views
What is the meaning of in C++?
14,431 Views
In Java, suppose X is an object of class Y and Y is a subclass of class Z, then X also has type Z, but is X also an object of class Z?
JAVA CODE
class HelloWorld {
public static void main(String[] args) {
int x=1;
do { System.out.print(x+":"); ++x;}
while(x++<=5);
}
}
Output
1:3:5:
- The if and else conditions have both been given. Only when the if block's condition is met will the print statement of the if block run. If not, the else block's print statement will be carried out. The Java programme to check eligibility for voting is provided below.
- the Java System. An argument supplied to println() is printed using this function.
- In your example, the evaluation of the expression contained within the if(expression) statement results in a call to printf. If the body (blank in your case) of the if is run depends on the value of this expression. Activate this post's status. The printf() function returns the total number of printed characters.
#SPJ2