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]
3 years ago
6

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

Computers and Technology
1 answer:
Mashcka [7]3 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
DDL statement for adding a column to an existing table is
vaieri [72.5K]

Answer:to add a column to existing table.

to rename any existing column.

to change datatype of any column or to modify its size.

to drop a column from the table.

Explanation:

hope this help

4 0
2 years ago
2560x1600 (apple)vs 1920x1200 (Dell), is there a big difference between those 2 based on screen resolution ? ​
Solnce55 [7]

Answer:

Yes

Explanation:

1920x1200 is a non-standard resolution which may not be fully supported, usually 1920x1080 (1080p) is preferred and has been standardised as a display resolution.

2560x1600 (WQXGA) is a more standardised display resolution, and will offer a lot sharper and crisper images as more pixels are being used to render the image. As a rule of thumb, the higher resolution - the better.

The difference between these two resolutions is about the same difference as 1080p and 2k, you are going to get twice as crisp an image.

However there are other factors, such as refresh rate that may come into play with a comparison with these two.

3 0
3 years ago
Please help! I don’t know the answer to it :( it’s Fashion marketing
Oxana [17]

Answer:

I believe the answer should be C)

Sorry if it’s wrong,but hope it helps

8 0
2 years ago
How do you open the Font dialog?​
Simora [160]

Explanation:

Click the Home tab.

In the Fonts group, click the dialog box launcher button.

The button is found in the lower-right corner of the Font group.

The Font dialog box contains all the commands for formatting text, including quite a few that didn’t find their way into the Font group on the Ribbon. As with all text formatting, the commands you choose in the Font dialog box affect any new text you type or any selected text in your document.

When you’ve finished setting up your font stuff, click the OK button. Or click Cancel if you’re just visiting.

Use the Ctrl+D keyboard shortcut to quickly summon the Font dialog box.

hope my answer helps

pls mark this as brainlist

be sure to follow me and I will follow you back

stay safe

good day

6 0
2 years ago
You are asked to simulate a binary search algorithm on an array of random values.An array is the list of similar type of element
Alex Ar [27]

Answer:

Explanation:

Problem statement:

to simulate a binary search algorithm on an array of random values.

Binary Search: Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty.

Input/output description

Input:

Size of array: 4

Enter array:10  20 30 40

Enter element to be searched:40

The Output will look like this:

Element is present at index 3

Algorithm and Flowchart:

We basically ignore half of the elements just after one comparison.

Compare x with the middle element.

If x matches with middle element, we return the mid index.

Else If x is greater than the mid element, then x can only lie in right half subarray after the mid element. So we recur for right half.

Else (x is smaller) recur for the left half.

The Flowchart can be seen in the first attached image below:

Program listing:

// C++ program to implement recursive Binary Search

#include <bits/stdc++.h>

using namespace std;

// A recursive binary search function. It returns

// location of x in given array arr[l..r] is present,

// otherwise -1

int binarySearch(int arr[], int l, int r, int x)

{

   if (r >= l) {

       int mid = l + (r - l) / 2;

       // If the element is present at the middle

       // itself

       if (arr[mid] == x)

           return mid;

       // If element is smaller than mid, then

       // it can only be present in left subarray

       if (arr[mid] > x)

           return binarySearch(arr, l, mid - 1, x);

       // Else the element can only be present

       // in right subarray

       return binarySearch(arr, mid + 1, r, x);

   }

   // We reach here when element is not

   // present in array

   return -1;

}

int main(void)

{ int n,x;

cout<<"Size of array:\n";

cin >> n;

int arr[n];

cout<<"Enter array:\n";

for (int i = 0; i < n; ++i)

{ cin >> arr[i]; }

cout<<"Enter element to be searched:\n";

cin>>x;

int result = binarySearch(arr, 0, n - 1, x);

   (result == -1) ? cout << "Element is not present in array"

                  : cout << "Element is present at index " << result;

   return 0;

}

The Sample test run of the program can be seen in the second attached image below.

Time(sec) :

0

Memory(MB) :

3.3752604177856

The Output:

Size of array:4

Enter array:10  20 30 40

Enter element to be searched:40

Element is present at index 3

Conclusions:

Time Complexity:

The time complexity of Binary Search can be written as

T(n) = T(n/2) + c  

The above recurrence can be solved either using Recurrence T ree method or Master method. It falls in case II of Master Method and solution of the recurrence is Theta(Logn).

Auxiliary Space: O(1) in case of iterative implementation. In case of recursive implementation, O(Logn) recursion call stack space.

8 0
3 years ago
Other questions:
  • List and the deference between MS access objects​
    8·1 answer
  • 20 Points!! Please hurry!!
    9·1 answer
  • A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed
    6·1 answer
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    7·1 answer
  • What is computer ? What is computer program? What is hard disk.
    12·2 answers
  • If I write too much for an exam answer, do I get downgraded?
    7·1 answer
  • If a work is in the public domain… Group of answer choices its copyright has expired. it may not be used for commercial purposes
    9·1 answer
  • How do you make a minecraft server. just the basics please. I only need ine for me and my friends.
    7·2 answers
  • Copy the formula in cell M7 to the range M8:M15, and edit the copied formulas to return the value from the column indicated by t
    15·1 answer
  • What are the advantage of an e-library​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!