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
Nataly_w [17]
3 years ago
13

What error occurs in the following program? #include using namespace std; int main() { int number1, number2, sum; cout <<

"Enter number 1:"; cin >> number1; cout << "Enter number 2:"; cin >> number2; number1 + number2 = sum; cout << "The sum of number 1 and number 2 is " << sum; return 0; }
Computers and Technology
1 answer:
Nady [450]3 years ago
7 0

Answer:

1. ‘cout’ was not declared in this scope.

2. ‘cin’ was not declared in this scope.

3. lvalue required as left operand of assignment.

Explanation:

The code gives the error cout and cin was not declare. This error means, we not include the library where they define.

cout and cin is the input/output instruction and they include in the library iostream file.

the last error is lvalue required as left operand of assignment.

lvalue means the assignable value, we actually do the wrong assignment.

number1 + number2 = sum;

here, sum is is the assignment variable. so, it must be in the right side of the '=' operator.

sum = number1 + number2 ;

Now, the above is correct. the value number1 plus number2 is assign to sum.

You might be interested in
What is the most commonly used tab in the Filter dialog box?
aleksandrvk [35]

The answer is Messages

3 0
3 years ago
Read 2 more answers
Pleassseeeee helppp!!!!
AnnZ [28]

Answer:

html

Explanation:

6 0
3 years ago
Which IDEs support multiple high-level programming languages? Select all that apply.
nata0808 [166]

Answer:

eclipse, xcode, and visual studio

6 0
3 years ago
Read 2 more answers
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
How will you keep the buzz going post-hackathon?
Anna71 [15]

Answer:

it would be nice if you gave some form of info here

Explanation:

in other words without information no help aka I'm slow and just need points

8 0
1 year ago
Other questions:
  • What is used in computers to communicate with wireless keyboards, mice, and printers?
    8·1 answer
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • Once a software program has been through one test cycle performed by the programmers and is running proper
    10·1 answer
  • Consider the most important item among all the categories of information stored on your personal computer. As it applies to that
    8·1 answer
  • What is the name of the advanced warrior race of robots in Doctor Who?
    10·2 answers
  • Claire wants to include animations in her presentation slides. Which element of the presentation programs interface will have th
    11·2 answers
  • Enter a character: * ASCII #42 Enter a character: exit Not a character
    7·1 answer
  • How do you do 3.4.5 Add parentheses for code hs? I need answers please
    15·2 answers
  • Which of the following is a property of TCP?
    8·1 answer
  • If your computer determines the destination address of a network packet is to a remote network.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!