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
Rasek [7]
3 years ago
9

You are writing a program that defines a variable within a loop, and then tries to use that variable outside the loop. However,

the program does not run as intended. What is the issue?
Computers and Technology
1 answer:
Law Incorporation [45]3 years ago
4 0

Answer:

The Variable is out of scope

Explanation:

In programming variables exists with scopes This could be local or global. When a variable is declared as a global variable it is available to all methods and procedures in the program. Java programming language as well as C++ and several others use the open and close braces to define the scope in programs. consider the following example

<em>public class ANot {</em>

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

<em>        int i = 0;</em>

<em>        while ( i<10){</em>

<em>            int sum = 0;</em>

<em>            sum = sum+i;       </em>

<em>        }</em>

<em>    }</em>

<em>}</em>

In this example, the variable i is global and can be assessed within the while loop but the variable sum is local to the while loop and cannot be assessed outside of it

You might be interested in
Maria found a cupcake recipe on a cooking blog. However, she would like to read comments and suggestions before she begins bakin
Mnenie [13.5K]
Maria should use the Cooking blog that has known and verified information and step by step instructions Comments can lead to disaster and/or incorrect recipe use
8 0
4 years ago
Read 2 more answers
A display or monitor with a larger number of ?
Leviafan [203]

Answer:

pixels

Explanation:

6 0
3 years ago
While working on a customer issue, your colleague calls and asks for help to resolve his issue. What should you do?A. Go ahead a
Lesechka [4]

Answer:

Request the colleague to call after sometime

Explanation:

While working on a customer issue, your colleague calls and asks for help to resolve his issue. What should be done is to "Request the colleague to call after some time."

This is because,e in situations like that, it is believed that the customer should come first, and that is the purpose of being there. For employee to serve the customer. A colleague can easily link up with other employees to get his issues sorted, or simply wait.

4 0
3 years ago
Why doesn't the ad load ?
baherus [9]
Try refreshing the page, if not restart your device check your internet etc.
3 0
2 years ago
Read 2 more answers
Its inventiveness uncertainty and futuristic ideas deals with science and technology,what is it?
Sedaia [141]

Answer:

Capital FM

Explanation:

8 0
3 years ago
Other questions:
  • Which is true regarding pseudocode?
    9·2 answers
  • If you have an application that is not responding and you want to force it to shut down, whichsystem utility can you use?
    8·1 answer
  • Why does the PC send out a broadcast ARP prior
    14·1 answer
  • What is the primary reason that companies use third party tracking cookies?
    12·1 answer
  • What is the output of the AWK program?
    11·1 answer
  • How should you behave in an online academic environment?
    7·2 answers
  • Which graphic file format is used for commercial purposes.
    10·1 answer
  • What is the best definition of inflation?
    14·1 answer
  • Free points <br><br><br><br><br> also if u wanna check out my spotlfy u can (xkuromist)
    6·2 answers
  • The storage capacity of Go ogle drive can be increased from ____________.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!