Answer:
import java.io.*;
import java.util.Scanner;
class divide {
public static void main (String[] args) {
Scanner num=new Scanner(System.in);//scanner object.
int userNum=num.nextInt();
while(userNum>1)//while loop.
{
userNum/=2;//dividing the userNum.
System.out.print(userNum+" ");//printing the userNum.
}
}
}
Input:-
40
Output:-
20 10 5 2 1
Input:-
2
Output:-
1
Input:-
0
Output:-
No Output
Input:-
-1
Output:-
No Output.
Explanation:
In the program While loop is used.In the while loop it divides the userNum by 2 in each iteration and prints the value of userNum.The inputs and corresponding outputs are written in the answer.
<span>Jun 15, 2011 - Multiplication and division can be achieved using bit operators, for example .... I discovered pretty much the same thing for Sun CC close to 20 years ago. ... Just to add a rough estimation: On a typical 16-Bit processor ..... Doing it yourself willaffect readability and possibly have no effect on performance.</span><span>
</span>
Answer:
B
Explanation:
all url's begin with https://
Stopping the car. Do not continue driving if your tire has failed or blown out. After you stop the car, call for roadside assistance. Remember, safety first when you're driving!