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
bonufazy [111]
3 years ago
14

I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the

number i typed, "3".

Computers and Technology
1 answer:
sweet-ann [11.9K]3 years ago
3 0

You're substracting one from the variable "exponent" with every iteration of the loop, and you told it to break out of the loop once "exponent" is 0, therefore, it's always going to end up as 0 at the end.


If you want to keep the input from the user, then declare another variable like "counter" and assign the value of "exponent" to it and use it for the loop


Or even better, do this for the loop:

for(int i = 0; i < exponent; i++)

{

//Code here

}

You might be interested in
Fifty part-time students were asked how many courses they were taking this term. The (incomplete) results are shown below. Need
Ne4ueva [31]

Answer:

The answer for B is 10% and for C is 40%.

Explanation:

To get the percentage for B you take the the frequecy of students taking 2 courses (5) and multiply it by 100 then you divide it by whole number of students.

For C you do the after adding the number of students taking 1 or 2 courses (20).

5 0
3 years ago
Easy STEAM question :)
lorasvet [3.4K]

Answer:

Explanation:

A civil Engineer builds buildings, roads and bridges.

4 0
4 years ago
Read 2 more answers
The _______ dialog box displays formatting tabs for Font, Number, and Alignment
statuscvo [17]

Answer:

The <u>Format Cells</u> dialog box displays formatting tabs for Font, Number, and Alignment

Explanation:

In MS Excel, Format Cells dialog box option, we found the following formatting tabs:

  • Number
  • Font
  • Alignment

To access the format cells dialog box, we follow the following steps.

  1. In MS Excel, Right click in Cell that needs formatting
  2. A drop down menu Show, Click on Format Cells option from the list.
  3. A dialog box appears that have different tabs of Number, Font, Alignment and protection
  4. Select the tab, where you want to change the format.

5 0
3 years ago
Compared to a virtual image, a real image
Musya8 [376]
D.  can be viewed on a screen

100% sure

hope it helps!
6 0
4 years ago
Read 2 more answers
Which branch of science helps avoid or minimize stress-related injuries at workplace?
worty [1.4K]
Psychology, because psychology is the study of how the mind works, and therefor what causes stress.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Jennifer is trying to install an anti-malware program on a computer that she believes might be infected. During the installation
    13·1 answer
  • Which phrase describes this image most precisely?
    10·1 answer
  • When you use a mouse to select a row or column in a table, word displays a(n) ____?
    5·1 answer
  • The Constitution party advances a conservative approach to issues and would most likely support policies that __________.
    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
  • ACME Corp. is developing a software program that can run on mobile devices so that customers can interact with the firm, view pr
    13·1 answer
  • What does the following if statement do?<br><br> if (num1 == Math.abs(num1))
    12·1 answer
  • ____ is any technology that aids in gathering information about a person or organization without their knowledge.
    14·1 answer
  • How do you mark someone brainliest? The person with the best explanation gets brainliest.
    11·2 answers
  • Which step do you think is most useful from big data life cycle and why?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!