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
Based on this information, what is their gross income for six months? Roderick
alexira [117]
Multiply what he makes a month by six
8 0
3 years ago
You receive an email from someone who claims to be a representative from your credit card company. The email asks you to click o
Tema [17]
B.) phishing
Definition of phishing:
Try to obtain financial or official information from internet users, usually sent as an email to look like it is from a legitimate company
6 0
3 years ago
g You and your friend both send documents to the printer, but the printer can only print one document at a time. What does it do
Sedbober [7]

Answer:

It places the document in a buffer

Explanation:

Since the printer can only print a document at a time, the other document is going to be placed in a buffer.

The print buffer can be described as a location in memory that has the function of holding data that is going to be sent to a computers printer. A print job such as in this scenario may remain in the buffer because another document is to be printed first.

Sometimes a document could be put in the buffer because the computer is waiting for the printer to respond. This is just another reason why documents are placed in a buffer.

5 0
3 years ago
Write a program to calculate surface area and volume of a sphere (ball). The program will ask user to input radius (meter(s)) of
oee [108]

Answer:

The following program is to calculate the surface area and volume of a sphere(ball) using macro in c language .

#include <math.h>  //header file for math functions

#define pi 3.1415     //using macro

#include <stdio.h>  //header file for printf() or scanf()

int main()   //main function

{  

   double radius;  //radius is a double type variable

   float surface_area, vol;    //surface_area andvolume is a float type variable

   printf("Enter the radius of the sphere : \n");     //printf() is use to print an output

   scanf("%lf", &radius);   //scanf() is use to take input from the user

   surface_area =  4 * pi * pow(radius,2);

   vol = (4.0/3) * pi * pow(radius,3);

   printf("The Surface area of the sphere is: %.3f", surface_area); // display surface area

   printf("\n Volume of the sphere is : %.3f", vol); // display volume

   return 0;  

}

Output:

Enter radius of the sphere : 4.4

Surface area of sphere is: 243.278

Volume of sphere is : 356.807

Explanation:

Here in this program  we  include the header file math.h and include the macro pi. after that taking the user input in radius and calculating the surface area and volume of sphere and finally display the result.

4 0
3 years ago
The most commonly used network topology where network endpoints connect to a central device is called
arsen [322]
That would be a star network. A star network isn't necessarily shaped like a star, of course, but like you mention this topology has a central device, usually a server of some sorts, and then many different endpoints coming out of that central device, such as the client computers for the server.
6 0
3 years ago
Other questions:
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • My home PC has IP address 192.168.1.22 and connects to the Internet through a NAT router. Assume I am downloading a web page fro
    5·1 answer
  • A circuit contains three resistors connected in series. the value of r1 is 150 , the value of r2 is 60 , and the value of r3 is
    8·2 answers
  • A franchise restaurant is attempting to understand if customers think their service is good day-to-day by summarizing a series o
    10·1 answer
  • IMPORTANT!!<br><br> How can you get real answer keys for edmentum (plato) courses as a student?
    11·1 answer
  • Best way to build a model bridge
    5·2 answers
  • Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1
    15·1 answer
  • can someone tell me what to do i’m kinda stuck and don’t know what he’s telling me to do pls ill give brainlist and points
    13·1 answer
  • Find the unknown quantities
    12·1 answer
  • the first thing to do when your computer gives you an error message is A restart the computer B press the F2 key C write down th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!