Ask Question
10 April, 12:41

What will the following segment of code output if 11 is entered at the keyboard? int number; cin >> number; if (number > 0) cout << "C++"; else cout << "Soccer"; cout << " is "; cout << "fun" << endl;

+1
Answers (1)
  1. 10 April, 13:11
    0
    C+ + is fun will be the output segment.

    Explanation:

    The following are the description of the statement.

    In the given statement we declared a variable "number" of "int" type. Read there value by the user in the "number " variable. After that, there is if block since as mention in the question the value of the number variable is 11 so the if block condition is executed and print C+ + on the console. Finally, the rest of the statement is executed which is after the else block it means it print is fun is printed on the console.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What will the following segment of code output if 11 is entered at the keyboard? int number; cin >> number; if (number > 0) cout ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers