mailmesanjayfashions mailmesanjayfashions
  • 23-07-2021
  • Computers and Technology
contestada

if a= ‘ Stay home, Stay safe’ , print its value
a. 3 times in the same line
( 2 x 1 = 2)
b. 2 times in different lines using one print statement

Respuesta :

SkyAutumnLeaf SkyAutumnLeaf
  • 23-07-2021

Answer:

Since the language isn’t stated, I’ll give answers in the two most-used (?) languages: Java and Python.

a) To print a’s value 3 times in the same line, in Java we would do:

System.out.print(a+a+a);

In Python, we would write:

print(a*3)

b) 2 times in different lines using one print statement

In Java, we would write

System.out.println(a+”\n”+a+”\n”+a);

In Python we would write:

print(a,a,a,sep=’/n’)

Hope this helps!

Answer Link

Otras preguntas

When does a full moon happen?
What form of hablar do i use in the sentence la estudiante hablar con el maestro
Without a coordinating conjunction, a comma between two independent clauses creates a comma splice. true or false which is correct use a comma to separate: 1.
What did the Thirteenth Amendment do? It abolished slavery. It gave women the right to vote. It made universal education mandatory. It established the right of
a. True b. False: A wave can slow down and lose energy even within the same medium.
Find the difference. 6rs - (-2rs) 4 3rs 4rs 8rs
Find the line y=2/5x if the y-coordinate is 20, what is the x-coordinate
Simplify: x^5/8 • x^3/8; 0 (is greater than or equal to) x
Solve for x. 13(x - 3) = 39 a. x = 1 b. x = 4 c. x = 6 d. x = 10
With regard to ongoing expenses, the most expensive type of long-term financing is the sale of common stock. Answer a. True b. False