subject

Q6) Trace the following programs and show what will be the output? (Show your work) int m=7, n=5;

System. out. println(" m = " + n +" n = "+ m);

m=m+5;

n=n*3;

System. out. println(" m = " + m + 2 + " n = "+ n);

m=m%n;

n=n%m;

System. out. println(" m = " + (m + 2) +" n = "+ n);

Q7) Trace the following programs and show what will be the output? (Show your work)

int m=5, n=7;

System. out. println(" m = " + m +" n = "+ n);

m = n;

n = m;

System. out. println(" m = " + m+" n = "+ n);

Q8) What is the output of the following program? Show your work.
int num1;
double num2;
num1 = 10/3;
num2 = 10/3;

System. out. println(" num1 = " + num1);
System. out. println(" num2 = " + num2);

num1 = (int)(10.0/3);
num2 = 10/3.0;

System. out. println(" num1 = " + num1);
System. out. println(" num2 = " + num2);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Which of the following examples has four beats in each measure?
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
You know the right answer?
Q6) Trace the following programs and show what will be the output? (Show your work) int m=7, n=5;...
Questions
question
Biology, 22.03.2020 22:41
question
Health, 22.03.2020 22:42
Questions on the website: 13722359