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
aniked [119]
4 years ago
6

How does a main program recieve info from a function in c++?

Computers and Technology
1 answer:
Mashcka [7]4 years ago
8 0
Main() is a user defined function from where execution of C/C++ programs start. It is the designated entry point to a program that is executed in an operating system. There must be at least one main() function in e<span>very C++/C program. A main program receive info from another function by writing the command int and then the name of the function and the parameters.</span>
You might be interested in
Write a while loop that prints that number doubled without reaching 100. Follow each number with a space. After the loop, print
elena55 [62]

Answer:

The program to this question as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int n; //defining integer variables

cout<<"Enter number: "; //message

cin>>n; //input value by user

while (n< 100) //loop for check condition

{

cout<<n<<" ";//print value

n=n*2; //calculate value

}

return 0;

}

Output:

Enter number: 8

8 16 32 64  

Explanation:

In the above C++ language code, a header file is included, then defining the main method, inside the method an integer variable n is defined, which is used for user input for calculating their double number.  

In the next step, The while loop is declared, and the loop variable n range is defined, that its value is less than 100, inside the loop the variable n is used to calculate, its double number, and print function "cout" to print its value.

4 0
3 years ago
When sending emails and setting goals, you want to go beyond checkpoints of activities for your goals. What are examples of chec
yulyashka [42]

Answer:

Open and click rates

Explanation:

Open and click rates are measuring units of how well your campaigns perform.

8 0
4 years ago
A palindrome is a string that reads the same from left to right and from right to left. Design an algorithm to find the minimum
stepladder [879]

Answer:

Explanation:

The following code is written in Python. It is a recursive function that tests the first and last character of the word and keeps checking to see if each change would create the palindrome. Finally, printing out the minimum number needed to create the palindrome.

import sys

def numOfSwitches(word, start, end):

   if (start > end):

       return sys.maxsize

   if (start == end):

       return 0

   if (start == end - 1):

       if (word[start] == word[end]):

           return 0

       else:

           return 1

   if (word[start] == word[end]):

       return numOfSwitches(word, start + 1, end - 1)

   else:

       return (min(numOfSwitches(word, start, end - 1),

                   numOfSwitches(word, start + 1, end)) + 1)

word = input("Enter a Word: ")

start = 0

end = len(word)-1

print("Number of switches required for palindrome: " + str(numOfSwitches(word, start, end)))

3 0
3 years ago
It is vital to the organization and the success of the disaster recovery plan that the plan be thoroughly tested on a(n) _______
Andreyy89

Answer:

Regular Basis.

Explanation:

The plans should be clearly defined and checked regularly according to the set parameters. Also, there needs to evaluate one every week various types of environmental assessment have to be done. As the Disaster Recovery is a set of policies procedures and tools one needs to keep it updated to the current version. As any business needs to operate.

8 0
3 years ago
Students working at individual PCs in a computer laboratory send their files to be printed by a server that spools the files on
Vanyuwa [196]

Answer:

Explanation:

Disk space is a limited resource on the spooling partition and once it is filled the will cause a deadlock. Every single block that comes into the spooling partition claims a resource, and the one behind that wants resources as well, and so on. Since the spooling space is limited and half of the jobs arrive and fill up space then no more blocks can be stored, causing a deadlock. This can be prevented allowing one job to finish and releasing the space for the next job.

5 0
3 years ago
Other questions:
  • Siva added a Contact Form to her website. This is used for the collection to be included in
    5·1 answer
  • Your environment includes many users who print documents often. A single print device isn't sufficient. You need a "printer pool
    7·1 answer
  • Professional photography is a competitive job field. <br> true <br> false
    12·2 answers
  • Identify a data type applied in an input element to create slider controls.
    13·1 answer
  • Review the following statements and select the ones that are correct regarding sorting accounts from the Adjusted Trial Balance
    5·1 answer
  • Larry finds it easy to run legacy programs and applications in a virtualized environment. how does the virtualization provider m
    7·2 answers
  • Problem: you need to write a code that read 2 array of size 10x10 of zero and ones that represent black
    8·1 answer
  • What does the noise reduction tool do?
    11·1 answer
  • From which latin word the word computer is derived​
    7·1 answer
  • Does CLAIRE https://claire-ai.org/vision/ considered a representative of Roy Rotwell's Fifth Generation of innovation?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!