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]
2 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]2 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
Given the strings s1 and s2 that are of the same length, create a new string consisting of the first character of s1 followed by
LiRa [457]

Answer:

s1='abc'

s2='wxyz'

length=len(s1)

s3=''

for i in range(length):

   s3+=s1[i]+s2[i]

print(s3)

3 0
3 years ago
One way to protect against a security threat to a computer system is to __________. Avoid external links with inconsistent URLs
Makovka662 [10]

One way to protect against a security threat to a computer system is to Avoid external links with inconsistent URLs.

<h3>What is malware?</h3>

Malware is any programme that is purposely designed to disrupt a computer, server, client, or computer network, leak private information, obtain unauthorised access to information or systems, deny users access to information, or otherwise interfere with the user's computer security and privacy.

One way to protect against a security threat to a computer system is to Avoid external links with inconsistent URLs. The reason for this is that such links may contain malware or spyware.

Learn more about Malware:

brainly.com/question/14276107

#SPJ1

7 0
2 years ago
Do you guys know if there's a way for me to find a Google doc that I typed but forgot to save if you do it for points i will rep
ValentinkaMS [17]

Answer:

Usually, Google Docs save automatically. If you remember some keywords that you typed, try searching for it. For example, if you typed up a report about dogs, search "dogs" when you're on the Google Docs home screen.

Explanation:

If this doesn't help, leave a comment and I'll try to help more!

4 0
3 years ago
Read 2 more answers
Why aren’t I leveling up? I have enough points and even a brainliest. Could an expert please help me!! I am really confused.
svlad2 [7]
This actually happened to me when I was supposed to be an expert. Answer one more question, log out and back in, and then you should be the next rank!
Hope this helps! Have a happy holiday!
8 0
3 years ago
A computer can read whatever you type into it.<br> A)True<br> B)False
motikmotik

Answer:

True

Explanation:

Everything typed into a computer is saved as data and logged.

3 0
2 years ago
Read 2 more answers
Other questions:
  • How many host ip addresses are available on a network with a subnet mask of 255.255.255.192?
    6·1 answer
  • Deterime the minimum number of multiplication operations needed to compute the following. Show the order of the computations.
    10·1 answer
  • Minimalism is a major movement in postmodern art. O True O False
    14·1 answer
  • Program Rock.java contains a skeleton for the game Rock, Paper, Scissors. Open it and save it to your directory. Add statements
    10·1 answer
  • Write a C++ program that allows the user to enter double values. Display one of two messages: "The first number you entered is l
    9·1 answer
  • Whats a hybrid wired network
    9·1 answer
  • What is the meaning of photography​
    5·2 answers
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • Complete the procedure for pasting content from a Word document in a message by selecting the correct term from
    7·2 answers
  • Write a recursive function named canmakesum that takes a list of * integers and an integer target value (sum) and returns true i
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!