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
Korolek [52]
3 years ago
8

TOPIC-PYTHON

Computers and Technology
2 answers:
Wewaii [24]3 years ago
6 0

Explanation:

r=r*10+d shifts the previous value to the left (by multiplying by 10) and adds a new digit.

So imagine r = 123 and you want to append 4 to it.

First r is multiplied by 10, so you have 1230. Then you add 4, and get 1234.

The r variable builds up the reverse of s, so it starts at 0.

mixer [17]3 years ago
4 0

This program prints a number with reversed digits. For example, if you input 3564, you'll get 4653.

Suppose you give s=45, and let's see what the code does line by line:

We give 45 as input, and define r=0.

Then, we enter the while loop. The instruction d = s%10 simply extracts the last digit from s. In this case, d=5.

The istruction r = r\ast 10+d adds a 0 at the end of the current value of r. Then we add d, so now the last digit of r is d: we're performing

0\cdot 10 + 5 = 5

Finally, the integer division s = s//10 cuts the last digit from s. So, after the first loop, we have

d=5,\quad r=5,\quad s=4

We enter the loop again. we have

d = s\%10 = 4\%10 = 4

The new value of r is

5\cdot 10 + 4 = 54

And the division s//10 returns 0, so we exit the loop.

And indeed we have r=54, which is 45 in reverse.

You might be interested in
Hello can you please help with this if you want to thank you!
nikklg [1K]

Answer:

hardware and software is the answer

8 0
3 years ago
Read 2 more answers
True or False. A network is a group of computers that can communicate.
Hunter-Best [27]
The answer is: false
3 0
3 years ago
Which of the following correctly revises the passive voice of the sentence above to active voice?
muminat

There is no question on the passive voice, therefore I cannot change it to an active voice.

I hope this helped!

6 0
3 years ago
Tasks you can perform online include which of the following?
nalin [4]

Answer:

k bhaneko hmm where ez the pic????????

8 0
3 years ago
Given a int variable named callsReceived and another int variable named operatorsOnCall write the necessary code to read values
erik [133]

Answer:

The code to this question can be given as:

Code:

int callsReceived,operatorsOnCall;    //define variable  as integer

Scanner ob= new Scanner(System.in);    

//create object of scanner class for user input

System.out.println("Insert the value of callsReceived");  //print message.

callsReceived = ob.nextInt();    //input value.

System.out.println("Insert the value of operatorsOnCall"); //print message.  

operatorsOnCall = ob.nextInt();    //input value.

if (operatorsOnCall == 0)  //check number  

{

System.out.println("INVALID");   //print message.

}

else

{

System.out.println(callsReceived/operatorsOnCall);   //print value.

}

Explanation:

In the above code firstly we define 2 integer variable that name is already given in the question. Then we create the scanner class object for taking user input. Then we print the message for input first and second value from the user. then we use conditional statement. If the second variable that is  operatorsOnCall is equal to 0. So It print INVALID. else it divide the value and print it.

3 0
3 years ago
Other questions:
  • Digital cameras are less susceptible to UV light true or false
    13·2 answers
  • The help desk received a call from a user who cannot get any print jobs to print on the locally shared printer. While questionin
    10·2 answers
  • Match the items with their respective descriptions.
    6·2 answers
  • Being able to express your thoughts in an email is a primary technology skill. true or false.
    9·2 answers
  • How much heat is required to convert 1 gm of ice into steam​
    12·1 answer
  • Is phone data used when connected to wifi
    12·1 answer
  • What do “phone-copying” systems allow investigators to do?
    9·1 answer
  • What is the purpose of this parallelogram shape in a flowchart?
    15·1 answer
  • Who doesn't like reeses
    11·2 answers
  • _______ is the use of software to assist in the creation, analysis, and modification of the design of a component or product.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!