Concept explainers
What is the output produced by the following lines of
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Digital Fundamentals (11th Edition)
Modern Database Management
Problem Solving with C++ (10th Edition)
Starting Out with Python (4th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- Write a program that asks the user to input a number, store that number in a variable called num1, then loop num1 times. Inside the loop output the value of the i variable. in javaarrow_forwardRefer to the plan below and write a Java program called PrintSum which outputs the sum of the numbers from 0 up to n, where n is input by the user:PlanInitialise total and counter to 0Get n from the userWHILE the counter is <=nupdate the totaladd 1 to counterPrint totalarrow_forwardWhat is the output produced by the following lines of program code?int n = (int)3.9;System.out.println("n == " + n);arrow_forward
- State the output of the code given the following below. void Unknown(double& x, double y, int &I, int J) { x = x + y; y = x + y; I = I + J; J = I + J; } double X = 10.0, Y = 20.0; int I = 30, J = 40; Unknown(X,Y,I,J); cout << X << Y << I << J;arrow_forwardWhat is the output of the following code fragment? int a = 10, b = 3; boolean answer = ((--a >= 10) && (--b == 20)); System.out.println(a + "," + b + "," + answer);arrow_forwardWrite a program that reads in two numbers typed on the keyboard and dividesthe first number by the second number. The program should output the dividend,divisor, quotient, and remainder on the screen.arrow_forward
- in Java What output is produced when the following program fragment is executed? for (int i = 0; i <= 4; i++) { for (int j = 0; j < 4 + i; j++) if (i == 4 || j == 4 - i) System.out.print("+"); else if (j > 4 - i) System.out.print("-"); else System.out.print(" "); System.out.println("+"); } Show your workingsarrow_forwardWhat is the output of the following code segments (when run independently)? int [ ] myAry = {10,20,30,40,50}; for (int x=0; x<=myAry.length-1; x++ ) System.out.print(" " + myAry[x] ); note : a java codearrow_forwardWrite a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Javaarrow_forward
- Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 ''' Type your code here. '''arrow_forwardGiven the following code, what is the final value of x? int x=1, y=2, z=3; bool w=true; x=w=y-z;arrow_forwardWhat is the output of the following sequence of loops? for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 10; j++) { System.out.print((i * j) + " "); } System.out.println(); }arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning