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
SpyIntel [72]
3 years ago
12

What will the following segment of code output if 11 is entered at the keyboard? int number; cin >> number; if (number &gt

; 0) cout << "C++"; else cout << "Soccer"; cout << " is "; cout << "fun" << endl; 1. C++ is fun 2. Soccer is fun 3. C++ 4. C++fun 5. Soccerfun
Computers and Technology
1 answer:
galina1969 [7]3 years ago
5 0

Answer:

1. C++ is fun

Explanation:

Writing the code more clear:

int number;

cin >> number;

if (number > 0)

          cout << "C++";

else

          cout << "Soccer";

cout << " is ";

cout << "fun" << endl;

On the IF line, the conditional expression is evaluated TRUE (11 > 0), so the string "C++" is printed.

Then, the ELSE sentence is not executed since the expression has been already evaluated as TRUE.

Notice there are no additional brackets, so only the line cout << "Soccer"; is considered inside the ELSE.

The two remaining lines are executed always.

The final result is:

C++  is fun

You might be interested in
¿Cuales son las empresas mas exitosas que aún usan hoja de cálculo? porfa es urgentee
dem82 [27]

Answer:excel

Explanation:

6 0
2 years ago
When installing wire into a terminal it is important the stripped part of the wire
lianna [129]
D is the answer.......
5 0
3 years ago
Freeeeeeee brainliest!!!
kondaur [170]

Answer:

Oh Thanks :)

Explanation:

7 0
2 years ago
Is Flip book drawings, frame by frame (need great drawing skills).
lyudmila [28]
I would say traditional animation
7 0
3 years ago
Enumerate the the risk in the preparation and cooking in starch and cereal dishes and other food​
Novay_Z [31]
———————————————————.
6 0
2 years ago
Other questions:
  • __________%of the users have left websites in frustration due to poor navigation.
    13·1 answer
  • What is hydraulic fracturing?
    7·1 answer
  • Write a function safeOpen() that takes one parameter, filename — a string giving the pathname of the file to be opened for readi
    15·1 answer
  • What is a sign of the brick and mortar and the virtual world meeting together?
    14·1 answer
  • Explain how the use of Git and a shared public Git repository simplifies the process of managing opensource development when man
    8·1 answer
  • Guess The Song: <br> What Popping Brand New Whip Just Hopped In, I Got options
    15·1 answer
  • If you wanted a smartphone with the fewest restrictions on application development which smartphone operating system should you
    9·1 answer
  • How are web design &amp; web development different from each other?
    9·1 answer
  • Which of the following lines of code correctly defines a function called combine? OA define "combine(a, b, c)" as: B. define(com
    9·1 answer
  • Computer programming 5
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!