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
pashok25 [27]
3 years ago
6

How do you get a code in C to count down from 5??

Computers and Technology
1 answer:
Valentin [98]3 years ago
5 0

Answer:

This is what the code should do:

“Lift off in T minus

5

4

3

2

1

Blast-off!”

When I run it, it just keeps printing ''Sum = 5'' forever.

Explanation:

Code:

int main(void) {

int sum = 5;  

int i;      

printf("Lift off in T minus\n");

for (i = 0; i < 5; i=i+i) {

   sum = sum - i;  

   printf("sum = %d\n",sum);  

}  

printf("Blast-off",sum);  

return 0;

You might be interested in
A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
luda_lava [24]

Answer:

B. Fuser unit

Explanation:

Based on the scenario that is being described it can be said that the most likely problem is the Fuser unit. This is a part that plays an important role in the printing process. This unit melts the toner and compresses it in order to leave the impression on the paper with heat. A faulty fuser unit will not compress correctly and leave wet ink on the paper causing it to smear.

7 0
3 years ago
printLarger is a method that accepts two int arguments and returns no value. Two int variables, sales1 and sales2, have already
gizmo_the_mogwai [7]

Answer:

<em>public static void printLarger(double sales1, double sales2){</em>

<em>        if (sales1>sales2){</em>

<em>            System.out.println(sales1+" is larger");</em>

<em>        }</em>

<em>        else {</em>

<em>            System.out.println(sales2+" is larger");</em>

<em>        }</em>

<em>    }</em>

<em>A complete code calling the printLarger method is given below</em>

Explanation:

<em>public class Larger{</em>

<em>    public static void main(String[] args) {</em>

<em>        int sales1 = 100;</em>

<em>        int sales2 = 120;</em>

<em>        printLarger(sales1,sales2);</em>

<em>    }</em>

<em>public static void printLarger(int sales1, int sales2){</em>

<em>        if (sales1>sales2){</em>

<em>            System.out.println(sales1+" is larger");</em>

<em>        }</em>

<em>        else {</em>

<em>            System.out.println(sales2+" is larger");</em>

<em>        }</em>

<em>    }</em>

}

6 0
3 years ago
Earthquakes happen in the Earth’s
Nostrana [21]
Earthquakes happen in the Earths "CRUST" because all of the tetonical plates are located in the crust.

hope this helped
5 0
3 years ago
Acrynom for wys or wyg
REY [17]
What you said? And what you get?
8 0
2 years ago
A laptop computer has two internal signals: An unplugged signal, which is '1' if the laptop's power supply is connected, and '0'
Brums [2.3K]

Answer:

The correct usage is a NOR gate which is indicated in the explanation.

Explanation:

The truth table for the given two signals, namely

p=unplugged signal

q=low battery signal

can  form a truth table of following form

Here p has 2 states

1 if the power supply is connected

0 otherwise

Similarly q has 2 states

0 if the battery has reached almost zero state

1 otherwise

As the condition for the Hibernate Signal is given as to only activate when the battery is low and the power supply is not connected. This indicate that the value of Hibernate signal should be 1 when both p and q are 0.

Using this condition, the truth table is formed as

unplugged signal | low battery signal |  Hibernate Signal

            0               |                 0             |             1

            0               |                 1              |             0

            1                |                 0             |             0

            1                |                 1              |             0

Now the truth table of NOR is given as

a    |     b    |  a or b   |   ~(a or b)

0    |     0    |      0      |        1

0    |     1     |      1       |        0

1     |     0    |      1       |        0

1     |     1     |      1       |        0

This indicates that the both truth tables are same thus the NOR gate is to be used for this purpose.

6 0
3 years ago
Other questions:
  • Which type of movement lets the player control an object's movement?
    5·1 answer
  • Ziffcorp, an it firm, uses a technology that automatically updates the antivirus software in all the computers in the firm whene
    13·1 answer
  • ​ If a class is reusable, that is to say that it can be used in several different applications, then it has been designed using
    5·1 answer
  • What are some causes of the number of bytes on the wire exceeding the number of bytes being captured?
    6·2 answers
  • 18. Using the same formatting elements and designs across slides in a presentation is important to develop?
    5·1 answer
  • What is the output after running the following code snippet? int number = 600; if (number &lt; 200) { System.out.println("Low sp
    15·1 answer
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
  • What is a project?
    5·2 answers
  • Explain the paging concept and main disadvantages of pipelined
    15·1 answer
  • You have a small business.Due to the recent pandemic you seem to be losing contacts with your suppliers and customers.You want t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!