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
WITCHER [35]
3 years ago
14

(TCO 4) What will the following program segment display? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1) { fun

ny = 0; serious = 0; } else if (funny == 2) { funny = 10; serious = 10; } else { funny = 3; serious = 3; } cout << funny << " " << serious << endl; }
Computers and Technology
2 answers:
katen-ka-za [31]3 years ago
7 0

Answer:

3 3

Explanation:

The operator modulus '%' is gives the reminder of the number.

for example:

7%2  it gives the result 1 because 1 is reminder after divided by 2.

Initially the value of funny is 7 and serious is 15.

then, 15 is modulus by 2 which gives 1 and it store in the funny.

After that, if else statement check for condition.  

funny != 1  this condition is FALSE because Funny is equal to 1.

it moves to else if part Funny == 2 condition again FALSE it then move to else part and execute the statement Funny contain 3 and serious contain 3.

and then display.

Therefore, the answer 3 3.

Mazyrski [523]3 years ago
5 0

Answer:

It'll be 3 3. Just because i think it is, duh

Explanation:

You might be interested in
Which component of a computing device drains the battery the fastest?(1 point)
Lostsunrise [7]
The display screen since it’s always bright
8 0
3 years ago
Read 2 more answers
Count Uppercase, Lowercase, special character and numeric values
Rina8888 [55]

Answer:

View Image

Explanation:

  1. Import the <em>#include <ctype.h> </em>so that you can use the function to check the characters in the string.
  2. Create variable to store letter counts and user input.
  3. Ask for user input with scanf().
  4. Loop through the user input and check each character. Increase count accordingly.
  5. Print out final result.

7 0
4 years ago
Read 2 more answers
Which of the following initializer lists would correctly set the elements of array n?
Elina [12.6K]

Answer:

The correct answer to this question is option (a).

Explanation:

In the programming language (java) the syntax for declaring,initializing single denominational array can be given as:

Syntax:

datatype array[] arrayname;            // declare the array

Example:             int [] a;                    

a = new int[5];              // create the array

int [] n ={2,5,7,9,3};                 // initialize all elements

Or

a[0] = 2;

a[1] = 22;

a[2] = 12;

a[3] = 20;

a[4] = 23;

In the above we define the way to initialize the array. So the correct way to set array element is option (a).

3 0
3 years ago
1. It manages the computer's memory and processes, as well as all of its software and hardware.
8_murik_8 [283]

Answer:

B. Computer operating system

Explanation:

the operating system (or OS) manages all of the hardware and software in the computer, and allows hardware and software to communicate.

We can also figure this out by process of elimination: Application software is just a fancy way to say apps, Graphical User Interface (or GUI) are menus that allow a user to use the computer through a visual representation (what you interact with using your mouse), and microcomputer just means a small computer like a laptop or a phone.

6 0
3 years ago
Write the definition of a function named rcopy that reads all the strings remaining to be read in standard input and displays th
pickupchik [31]

Answer:

//Include this header file if program is executing on //visual studio.

#include "stdafx.h";

//Include the required header file.

#include <iostream>

#include <string>

//Use the standard namespace.

using namespace std;

//Define the function rcopy.

void rcopy()

{

    //Declare a string variable to store the string.

    string s;

    //Prompt the user to input the string.

    cin >> s;

    //Check if the string entered by the user reach to

    //the next line character.

    if (cin.get() == '\n')

    {

         //Display the last word in the string.

         cout << s << " ";

         //Return from the if statement.

         return;

    }

    //Make a recursive call to the function rcopy.

    rcopy();

    //Display the remaining words in the string in

    //the reverse order.

    cout << s << " ";

}

//Start the execution of the main method.

int main()

{

    //Call the function rcopy.

    rcopy();

    //Use this system command to hold the console screen      //in visual studio.

    system("pause");

    //Return an integer value to the main function.

    return 0;

}

Explanation:

See attached images for the code and output

5 0
3 years ago
Other questions:
  • What is a organisation in office technology
    7·1 answer
  • In a formatted text file, ________ signal(s) the beginning and end of a formatting command.
    12·1 answer
  • One of the main purposes of special effects is to accomplish shots that would be too expensive, too dangerous or just plain impo
    9·2 answers
  • Create a new file that contains a summary of the total consumption for three sectors: "Residential," "Commercial," and "Industri
    10·1 answer
  • PLEASE HELP
    6·1 answer
  • Although heart rate increases and decrease depending upon activity level on average a typical person heart rate is about _____ b
    10·1 answer
  • in access, entering the search criteria "B?" would yield which of the following results? a. bentonville b. be c. brimingham d. b
    14·1 answer
  • 2.7 code practice question 1 edhesive
    13·2 answers
  • During the post process,the Bios uses two different ways to notify you of a problem. Error beep codes and error messages .Explai
    10·1 answer
  • A _______ attack is where the input includes code that is then executed by the attacked system.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!