Answer:
i like ghost and modern 3
Explanation:
Answer:
public static int maxMagnitude(int a, int b){
int max;
if (a>b){
max = a;
}
else{
max = b;
}
return max;
}
The complete program calling the method is given in the explanation section
Explanation:
import java.util.Scanner;
public class ANot {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Please Enter two numbers");
int num1= in.nextInt();
int num2 = in.nextInt();
System.out.println("The largest magnitude number is: "+maxMagnitude(num1,num2));
}
public static int maxMagnitude(int a, int b){
int max;
if (a>b){
max = a;
}
else{
max = b;
}
return max;
}
}
The maxMagnitude() method uses if/else statement to compare two ints and return the larger one
Answer:
for e in range(6, 15, 2):
for o in range(5, 15, 2):
calc = e+o
print(e, "+", o, "=", calc)
Explanation:
You're setting the value of user_num to 20. Doing this won't allow the other test cases to run. Simply delete that line and your code should work. This is the code I wrote:
user_num = int(input())
while user_num>=1:
user_num/=2
print(user_num)
I wrote my code in python 3.8. I hope this helps.