Answer:
a software program for storing, managing, and retrieving information
Explanation:
Answer:
All of these statements are true.
Explanation:
Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.
It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.
This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.
and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.
Answer:
import java.util.Scanner;
public class DashLine {
public static void main(String[] args) {
// Declaring variables
int n;
/*
* Creating an Scanner class object which is used to get the inputs
* entered by the user
*/
Scanner sc = new Scanner(System.in);
// Getting the input entered by the user
System.out.print("Enter a number :");
n = sc.nextInt();
// calling the method by passing the user entered input as argument
dashedLine(n);
}
//This method will print the dashed line for number greater than zer
private static void dashedLine(int n) {
if (n > 0) {
for (int i = 1; i <= n; i++) {
System.out.print("-");
}
System.out.println();
}
}
}
Explanation:
The answer might be wrong and you could get caught