Answer:
The following code as follows:
Code:
max=name1; //define variable max that holds name1 variable value.
if (strcmp(name2, max)>0) //if block.
{
max=name2; //assign value to max.
}
if (strcmp(name3,max)>0) //if block.
{
max=name3; //assign value to max.
}
Explanation:
In the above code, we define a variable that is max. The data type of max variable is the same as variables "name1, name2, and name3" that is "char". In the max variable, we assign the value of the name1 variable and use if block statement two times. In if block, we use strcmp() function that can be defined as:
- In first if block we pass two variables in strcmp() function that is "name2 and max" that compare string value. If the name2 variable is greater then max variable value so, the max variable value is change by name2 variable that is "max=name2".
- In second if block we pass two variables in strcmp() function that is "name3 and max" that compare string value. If the name3 variable is greater then max variable value so, the max variable value is change by name3 variable that is "max=name3".
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:
Sharing your personal information and identity theft but if you’re supposed to choose one then sharing your personal information must be right
00110001 00110100 00110000
D I,II and III is the answer i think