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
How do you add text to a blank slide layout?
melisa1 [442]
<span>To add text anywhere on a slide (outside placeholders), click on the Insert menu --> Text Box, or on the text box icon on the drawing toolbar.Click and hold down the left mouse button while you drag the mouse. ...<span>Click inside the text box and start typing.</span></span>
8 0
3 years ago
Read 2 more answers
Hurry please
Yanka [14]

Answer:

to get the client to imagine

Explanation:

3 0
3 years ago
Only Lysita knows the password for the question......
emmasim [6.3K]
The correct answer is 1234.

7 0
3 years ago
Your motherboard supports dual channeling and you currently have two slots populated with DIMMs; each module holds 2 GB. You wan
Olenka [21]
One 4-GB DIMM. Dont really have a explanation for it just comes from previous experience
6 0
3 years ago
Read 2 more answers
Which command let’s you increase or decrease the on-screen magnification of your document
JulijaS [17]
Ctrl - and ctrl +       i hope that is good for you                         
8 0
3 years ago
Other questions:
  • Which is the output of the formula =AND(12&gt;6;6&gt;3;3&gt;9)
    6·1 answer
  • I dopped my Fujifilm Instax mini 8 and now the case won't close and it takes blank pictures can anyone tell me what to do, pleas
    6·2 answers
  • Many companies use software to scan resumes and search for _____________.
    10·1 answer
  • Which of the following can be created when two tables contain a common field?
    14·1 answer
  • Sulfur content is measured in
    11·1 answer
  • It connects computers in different cities and different countries
    9·2 answers
  • interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
    7·1 answer
  • True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that int
    10·1 answer
  • Which code will print a random number between 1 and 100?
    15·2 answers
  • b. Write a complete program for the following situation related to setting the speed of a car to preset values before starting a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!