import java.util.Scanner;
public class JavaApplication57 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter two numbers:");
int num1 = scan.nextInt();
int num2 = scan.nextInt();
while (num1 <= num2){
if (num1 %2 == 0){
System.out.print(num1+" ");
}
num1+=1;
}
}
}
I hope this helps!
Answer:
- Calculate the additional CPI due to the icache stalls.
- Calculate the additional CPI due to the dcache stalls.
- Calculate the overall CPI for the machine.
The additional CPI due to icache stalls = Hit Rate * Hit Latency + Miss Rate*
Miss Penalty = 0.9*2 + 0.1*50 = 1.8 + 5 = 6.8
The additional CPI due to dcache stalls = 0.92*2 + 0.08*124 = 11.76
The overall CPI = 0.3*11.76 + 0.7*1.0 + 1.0*6.8 = 11.03 7.
Explanation:
A program that is required to three (3) numbers. calculate and print their total is given below:
<h3>The Program</h3>
import java.util.Scanner;
public class SumAndAverage {
public static void main(String[ ] args) {
System.out.println("Enter three numbers - ");
// Accepting and finding sum of numbers.
int sum = 0;
Scanner sc = new Scanner(System.in);
for (int i = 0; i < 3; i++)
sum += sc.nextInt( );
// Printing sum and average.
System.out.println("Sum - " + sum);
System.out.println("Average - " + (sum / 3f));
}
}
The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total
Read more about programming here:
brainly.com/question/23275071
#SPJ1