1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pochemuha
3 years ago
12

Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement? 1 2 3 4 5 6 7 public

class Test { public static void main(String[] args) { System.out.println("39 + 3"); System.out.println(39 + 3); System.out.println("39" + 3); } }
Computers and Technology
1 answer:
KengaRu [80]3 years ago
3 0

Answer:

39 + 3

42

393

Explanation:

In this line System.out.println("39 + 3"), the quotation marks are used to delimit a string, then when printed in the console the string is printed as-is.

In the next line: System.out.println(39 + 3), without the quotation marks, the 39+3 is treated as a normal addition and prints the result of the operation.

In the last line printed with the code System.out.println("39" + 3,; the symbol + is used to concatenate the string 39 with the number 3, since the string has no spaces they are printed together.

You might be interested in
Difference between Hard copy and Soft copy?​
otez555 [7]

Answer: a hard copy is a printed or physical copy of a document, while a soft copy is a virtual or online copy of the document that is stored on your hard drive or computer.

Explanation:

8 0
3 years ago
Which property do you use to align an element horizontally with the left or right edge of its parent element?
Ugo [173]
A thank me later:) give me hearts
3 0
3 years ago
Ventajas y desventajas de la prevención de descargas​
Dahasolnce [82]
Amigo o amiga q está haciendo esto no c que seg oficia y lo siento
7 0
3 years ago
_____ are different, even within the same job. a. Occupations b. Workplaces c. Careers d. Interest rates
pickupchik [31]
Hello,

Here is your answer:

The proper answer to this question is option B or "workplaces". Workplaces are where the person stays to do his or her job although they have the same job WORKPLACES are different.

Your answer is B.

If you need anymore help feel free to ask me!

Hope this helps!
3 0
4 years ago
Read 2 more answers
2. The factorial of a positive integer n is the product of the integers from 1 to n. You can express the factorial of a positive
Molodets [167]

Answer:

import java.io.*;

import java.util.Scanner;//importing the scanner.

class Factorial {

public static void main (String[] args) {

    Scanner fact=new Scanner(System.in);//creating a scanner object for taking the input.

    int t,n;//t for number of times the user want to calculate the factorial and n for factorial.

    System.out.println("How many times you want to calculate the factorial");

    t=fact.nextInt();//taking input of t.

    while(t>0)

    {

        int f=1;//f for calculating the variable.

        n=fact.nextInt();//taking input of n .

        if(n>10||n<1)//if n is out of range then again taking input.

        {

           while(n>10 || n<1)

                {

                        System.out.println("Please Enter the Valid Input");

                 n=fact.nextInt();

                }

               for(int i=1;i<=n;i++)//calculating the factorial.

               {

                   f*=i;

               }

               System.out.println("The factorial is: "+ f);

        }

        else // if n is in  range then definitely calculating the factorial.

        {

             for(int i=1;i<=n;i++)// calculating the factorial.

               {

                   f*=i;

               }

               System.out.println("The factorial is: "+ f);

        }

    }

}

}

Output:-

How many times you want to calculate the factorial

2

-5

Please Enter the Valid Input

4

The factorial is: 24

5

The factorial is: 120

Explanation:

The above written code is for calculating the factorial of an integer the number of times user want to calculate the factorial.The code wants user to enter again until the value entered by the user is in range.If the value is in range then it definitely calculates the factorial.

6 0
3 years ago
Other questions:
  • Need answers for 11&amp;12. Due today. Thanks.
    14·1 answer
  • What is the keyboard command that allows you to copy text
    12·2 answers
  • A dog walks 10 km north in 2 hours and then 8 km south in 1 hour.
    10·1 answer
  • The major types of wireless media are______________.
    6·1 answer
  • What is a GUI?
    11·1 answer
  • Which component is a part of the CPU of a computer
    12·2 answers
  • If you want to display information from a database to someone who is not a user of the database, you will have to use:
    7·1 answer
  • I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that
    10·1 answer
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
  • __________ translates analog voice signals into digital data and uses the Internet to transport the data.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!