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]
2 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]2 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
What is the force that resists the motion of an object through a fluid?
STALIN [3.7K]

Answer:

Friction (drag)

Explanation:

The force resisting motion through a fluid is a type of friction, that is called drag.

4 0
2 years ago
Exporting data is sending data to a new file. true or false
dolphi86 [110]
False__________________________
8 0
3 years ago
Read 2 more answers
I GOT A 65% LAST TIME AND IM DOING RETAKE! PLEASE DONT FAIL ME THIS TIME
yawa3891 [41]

Answer:

Explanation: c vecause am pro

4 0
2 years ago
Read 2 more answers
To assign a new keyboard shortcut, you would access backstage, word options then
Zarrin [17]
Customize ribbon, and the customize button.
6 0
2 years ago
Unless otherwise specified, entire arrays are passed __________ and individual array elements are passed __________.
Vaselesa [24]

Answer:

By reference ; by value

Explanation:

An array is defined as the arrangement of a certain item in a well orderly manner/ fashion.

Unless otherwise specified, entire arrays are usually passed by reference and individual array elements are passed by value which is the standard norm in the mode of operations.

7 0
2 years ago
Other questions:
  • Which of the following correctly describes the syntax of an If statement?
    9·1 answer
  • Which RFC reserves three ranges of IP addresses for private use - a single Class A (10.0.0.0-10.255.255.255), 16 Class Bs (172.1
    15·1 answer
  • HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu
    5·1 answer
  • ​_____ was the first commercially successful computer. ​z3 ​eniac ​univac ​colossus
    13·1 answer
  • What is the advertising photographer’s main objective in creating an image?
    11·1 answer
  • Examine the efficiency the various recovery algorithms used in deadlock handling
    10·1 answer
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Picture related to cyber safety
    10·2 answers
  • How to remove special formatting from a table in word.
    5·1 answer
  • _is the joining of two or more electrical conductors by mechanically twisting the conductors together or by using a special spli
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!