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
lukranit [14]
3 years ago
5

Write a while loop that lets the user enter a number. The number should be multiplied by 10, and the result assigned to a variab

le named product. The loop should iterate as long as product is less than 100.
Computers and Technology
1 answer:
pentagon [3]3 years ago
6 0

Answer:

#include <stdio.h> // header file inclusion

int main() // main function declaration

{

    int number,product=0; // variable declaration

    while(product<100) // while loop

   {

       scanf("%d",&number); // input a number

       product= number*10; // multiply the number by product

       printf("%d\n",product); // print the value of product

   }

 return 0; // return statement

}

Output:

  • If the user enter 10 then the loop terminates for the first time and the output is 100.
  • If the user enter 5,10 then the loop executes in 2 times and the output is 50 and 100.

Explanation:

  • Firstly there is an inclusion of header file which understands the meaning of printf() and scanf() function.
  • Then there is the main() function definition
  • Then we declare a two-variable (number and product) of integer type.
  • Then we define a while loop and check the condition that product value is less than 100 or not.
  • Then we take input and multiply by 10.
  • Then we assign the value in the product and print the product value.
You might be interested in
Which describes the safest way to sit at a desk while typing on the computer?
Anna35 [415]

Answer:

Keep the knees and hips at 90-degree angles and the wrists straight.

Explanation:

From computer ergonomics, sitting at a desk and typing can affect the back, cause discomfort and sometimes injury. To protect the back, always sit with the knee and hips positioned at 90 degree while keeping the wrist straight and also position the equipment appropriately to always suite this posture.  

7 0
3 years ago
What is the output of the code below assuming that global variable x has value 2 and global y has value 3? def f1(): return "ab"
Lostsunrise [7]

Answer:

ababababab

Explanation:

The code above is written in python and python uses indentation .So let me rephrase the code accordingly and explain what the code really do.

Note x and y is a global variable which can be used by any of the function declared.  According to the question x and y are 2 and 3 respectively

The first block of code describes a function f1 without any argument but the code should return the string "ab"

def f1():

      return "ab"

The second block of code defines a function f2 and returns the value of f1 multiply by x. This means you are multiplying the string "ab" by 2 which will be equals to abab

def f2():

           return f1() * x

The third block of code declared a function f3 and returns the sum of  f2 and product of f1 and y. using PEMDAS principle the multiplication aspect will be solved first so, ab × 3 = ababab, then we add it to f2  . ababab + abab = ababababab.

def f3():

        return f2() + f1() * y

Finally, we print the function f3 value to get ababababab

print(f3())

If you run the code on your IDE like below you will get  ababababab

x = 2

y = 3

def f1():

      return "ab"  

def f2():

      return f1() * x  

def f3():  

      return f2() + f1() * y  

print(f3())

     

7 0
3 years ago
Select the correct answer
Vaselesa [24]

Answer:

professional integrity

Explanation:

The work he is doing is comes under the violation of professional integrity. Because professional integrity is the set of ethics that should be followed by the employ. These ethics includes honesty, loyalty and dependability.

5 0
4 years ago
If a stadium pays $20,000 for labor and $13,000 for parking, what is the stadium's profit margin if the game generates $206,000
Temka [501]

Answer:$30,300

Explanation:

8 0
3 years ago
Read 2 more answers
COMPUTER CODING
scZoUnD [109]

Answer:Maybe put in Ball.move.left.right(100)

Explanation:

If the ball should move then the code might be left and right,

I don't know if I am right but I do coding too.

3 0
3 years ago
Other questions:
  • In a switch statement, if a break statement is missing, _______________. Select one: a. the default case is automatically execut
    15·1 answer
  • We can harden a host by: a. Limiting physical access to it b. Turning off unnecessary services c. Installing patches d. All of t
    8·1 answer
  • Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the sav
    10·1 answer
  • When using a public computer or network, you should always _______. A. install a firewall. B. run an anti-virus program beforeha
    11·2 answers
  • When a member function is defined outside of the class declaration, the function name must be qualified with theWhen a member fu
    14·1 answer
  • What is the color of red?
    9·2 answers
  • (k + 3)by the power of 3​
    9·1 answer
  • 1 bulb controlled by 2-three way switches using 12 volts battery.<br><br> pahelp po
    10·1 answer
  • Dean has been using computers for some time now, but he is unfamiliar with a number of utility programs. In order to better main
    12·1 answer
  • You'd like to change the minimum password length policy in the default domain policy group policy preference (gpo). What's the b
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!