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
Which type of data is most sensitive and should be protected from malware?
Dennis_Churaev [7]
The correct answer is “C. The credit card number that you use to make an online purchase”
5 0
2 years ago
Focusing on the general characteristics of a problem or object, while ignoring the details, is a technique called
Taya2010 [7]

Answer:

Abstraction

Explanation:

In computer science, abstraction has a similar definition. It is a simplified version of something technical, such as a function or an object in a program. The goal of "abstracting" data is to reduce complexity by removing unnecessary information. At some level, we all think of computers in abstract terms.

5 0
3 years ago
View the attached picture
amm1812

A. B)

B. B) 1837 Douglass joins the East Baltimore Improvement Society

C. A) offers effects when moving from one slide to the next.

Hope this helps!!


8 0
3 years ago
ethics and internal control are important applications in accounting . Provide FIVE code of ethics and five internal control mea
IceJOKER [234]
Ethics:
- to ensure that privacy will not be lost.
-ensuring personal information is not lost
-information in the accountings will not be submitted or shared with anyone
-information will be saved and viewed by the business.
- The business will not falsely make the accountings.
6 0
3 years ago
At your job, you often have to address letters to the customer support manager, Tyson Kajewski. The problem is that you are cons
krek1111 [17]
Input his name in the dictionary function, you can also copy the given name an paste as much as you need
5 0
4 years ago
Other questions:
  • Unix has experimented with several security programs. a user can attach a watchdog program to a file that grants or denies acces
    13·1 answer
  • Look at the graph below. Which statement is TRUE based on the graph of an egg drop experiment?
    10·1 answer
  • By generating and delivering timely and relevant information supported by networks, _____ creates new opportunities for conducti
    15·1 answer
  • At the coffee shop where they work, Jen is the safety officer, Richard is in charge of administering first aid, Ashley is respon
    13·2 answers
  • The World Wide Web is full of unstructured data. Search engines like Google, Bing and Yahoo have been doing a good job of allowi
    6·1 answer
  • What is income?
    10·2 answers
  • Which statement is false? Select one: a. Function printf does not care how large the array it is printing is. b. Function scanf
    9·1 answer
  • When entering data in Access if the data is entered using an Access form, that data is stored in a table or tables. TRUE FALSE
    12·1 answer
  • Which term describes a visual object such as a picture a table or text box
    15·2 answers
  • Differentiate between refraction of light and reflection of light
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!