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
Airida [17]
2 years ago
14

Write two alternate functions specified below, each of which simply triples the variable count defined in main. These two functi

ons are: a. Function tripleByValue that passes a copy of count by value, triples the copy and returns the new value.b. Function tripleByReference that passes count by reference via a reference parameter and triples the original value of count through its alias(i.e. the reference parameter)For example, if count
Computers and Technology
1 answer:
Vedmedyk [2.9K]2 years ago
7 0

Answer:

Following are the code to this question:

#include <iostream>//header file

using namespace std;

int triplebyValue(int count)//defining a method triplebyValue

{

int x=count*3;//defining a variable x that multiply by 3 in the count  

return x;//return value of x

}

void triplebyReference(int& count)//defining a method triplebyReference that hold count variable as a reference in parameter

{

count*=3;//multipling a value 3 in the count variable

}

int main()//main method

{

int count;//defining integer variable

count=triplebyValue(3);//use count to call triplebyValue method

cout<<"After call by value, count= "<<count<<endl;//print count value with message

triplebyReference(count);//calling a method triplebyReference

cout<<"After call by reference, count= "<<count<<endl;//print count value with message

return 0;

}

Output:

After call by value, count= 9

After call by reference, count= 27

Explanation:

In this code two methods "triplebyValue and triplebyReference" are declared, which accepts a count variable as a parameter, and in both multiply the count value by 3 and return its value.

Inside the main method, an integer variable "count" is declared that first calls the "triplebyValue" method and holds its value into count variable and in the next, the method value is a pass in another method that is "triplebyReference", and use print method to print both methods value with a message.

You might be interested in
Identify a major drawback of browsing web pages on mobile devices.
Pavlova-9 [17]
It was way too much of a drawback
5 0
3 years ago
Which support function under Tech Mahindra is governing data privacy and protection related requirements
Alex Ar [27]

Answer:

Privacy Policy

Explanation:

PRIVACY POLICY is the support function under Tech Mahindra that is governing data privacy and protection-related requirements.

Given that support functions are functions which assist and in a way contribute to the company goal.

Other support functions are human resources, training and development, salaries, IT, auditing, marketing, legal, accounting/credit control, and communications.

The above statement is based on the fact that the Privacy Policy clarifies all the data protection rights, such as the right to object to some of the production processes that TechM may carry out.

7 0
3 years ago
What is SEO?<br> Training Live Online Instructor-Led Learning, https://www.peoplentech.com.bd/<br> ,
evablogger [386]

Answer:Search engine optimization (SEO) is the process of optimizing your online content so that a search engine likes to show it as a top result for searches of a certain keyword. ... When it comes to SEO, there's you, the search engine, and the searcher.

Explanation:

4 0
2 years ago
Name the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the
Artemon [7]

Answer:

Parity Bit

Explanation:

Given that Parity bit is a form of strategy or method that utilizes a scheme in adding a solitary bit to a binary string. This can be either 1 or 0, thereby making the total quantity of bit to become either odd parity bit or even parity bit during storage.

Hence, the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the number is called PARITY BIT.

7 0
2 years ago
Which of the following grinding methods is best suited to a shorter cylindrical workpiece?
schepotkina [342]
well i dont know but i would go with b :D

4 0
3 years ago
Other questions:
  • What type of Windows Server is the most likely server to be targeted by a computer hacker?
    13·2 answers
  • Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the bat
    12·1 answer
  • Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
    9·1 answer
  • What is a good voltage measurement on a brand new, 6 volt golf cart deep cycle battery after the first charging?
    10·1 answer
  • What would happen to a eukaryotic cell if all its mitochondriawere destroyed
    7·1 answer
  • What are two types of formulas in Excel
    13·2 answers
  • What does the phrase at the drop of a hat mean?
    11·2 answers
  • In which of the following scenarios would you choose to embed versus import data?
    8·1 answer
  • Computer network reduces the cost of operation​
    14·1 answer
  • Complete the problem about Olivia, the social worker, in this problem set. Then determine the telecommunications tool that would
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!