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
Lady_Fox [76]
3 years ago
9

What will the following code display? #include using namespace std; void doSomething(int); int main() { int x{2}; cout <<

x << '\n'; doSomething(x); cout << x << '\n'; return 0; } void doSomething(int num) { num = 0; cout << num << '\n';
Computers and Technology
1 answer:
Leno4ka [110]3 years ago
8 0

Answer:

The code will display the following on the screen:-

2

0

2

Explanation:

The output is like this because x{2} assigns the value 2 to the integer x.First the value of x is printed on the screen that is 2 and that newline is used to go to the next line.After that function is called doSomething with x passed as the argument. doSomething function assigns the value zero to the variable passed and prints it on the screen.So the next line is 0.Since x is passed by value so no changes will appear in the original argument.Hence the last line printed is 2.

You might be interested in
a. Write a function called fizzbuzz. This function will take 1 number as a parameter. The function will print all numbers from 0
OLga [1]

Answer:

def fizzbuzz (num):

 for item in range(num):

   if item % 2 == 0 and item % 3 == 0:

     print("fizzbuzz")

   elif item % 3 == 0:

     print("buzz")

   elif item % 2 == 0:

     print("fizz")  

   else:

     print (item)

fizzbuzz(20)

Explanation:

Using Python programming Language

Use a for  loop to iterate from 0 up to the number using the range function

Within the for loop use the modulo (%) operator to determine divisibility by 2 and 3 and print the required output

see attached program output screen.

5 0
3 years ago
A database is a collection of integrated and related _____.
ioda
C) files
Because technologys data goes into files
4 0
3 years ago
Read 2 more answers
Your eighty-three-year-old grandmother has been using a computer for some time now. As a way to keep in touch, you frequently se
Sergeu [11.5K]

Answer:

Cultural lag

Explanation:

Cultural lag is a situation where by a society experiences technological development at a rate faster than the development that occurs in culture and general way of life.

A very good example is that it takes a longtime before cultural development can match up with technological developments and advancements thus leading to social problems due to lag. The cultural lag theory was formed in 1922 by William F Ogburn a sociologist.

3 0
3 years ago
Generally, information is extracted from __ for communication.
denis-greek [22]
Extracting information from the message.  It i<span>s exclusive to the "interpreting the message" step in a business communication process.</span>
7 0
3 years ago
Select the correct text in the passage.
Maurinko [17]

Answer:

some parents have replaced the customary practice of reading a bedtime story to childern with a television show of the child's choice

Explanation:

7 0
3 years ago
Other questions:
  • Hello, my first time being here and I'm returning back from college and I'm now studying Java in college but I was stuck doing t
    15·1 answer
  • Pls help is very urgent and I will mark u as brainliest plsssss​
    11·2 answers
  • Least common multiple of 78,90, and 140
    10·2 answers
  • Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
    9·1 answer
  • If you copy a drawing from the Internet and use it in a report, you might be violating the artist's
    8·1 answer
  • What do you mean by algorithm​
    9·2 answers
  • A _______ template is used to maintain consistency in terms of margins and page numbers .
    6·1 answer
  • For what reason can security risks never be fully eliminated?​
    7·1 answer
  • Ema Company for business .
    14·1 answer
  • ________ has the ability to drag windows to the edges or corners of your screen and have them snap into place.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!