Knowee
Questions
Features
Study Tools

normal function c++

Question

normal function c++

🧐 Not the exact question you are looking for?Go ask a question

Solution

It seems like you want to know about how to write a normal function in C++. Here's a step-by-step guide:

  1. Function Declaration: This is the first step where you declare the function. It includes the return type, function name, and parameters if any. For example:
int add(int a, int b);

In this case, add is the function name, int is the return type, and a and b are the parameters.

  1. Function Definition: This is where you write the actual code that will be executed when the function is called. It should match the function declaration. For example:
int add(int a, int b) {
    return a + b;
}

In this case, the function add takes two integers as parameters and returns their sum.

  1. Function Call: This is where you use the function in your code. You need to provide the arguments that match the parameters in the function declaration. For example:
int main() {
    int sum = add(5, 7);
    cout << "The sum is: " << sum << endl;
    return 0;
}

In this case, the function add is called with 5 and 7 as arguments. The result is stored in the variable sum and then printed.

Remember, the function should be declared before it is called in the code. If the function definition is written before its call, then there's no need for a separate declaration.

This problem has been solved

Similar Questions

normal function c++

Suppose Z follows the standard normal distribution. Use your z table, to determine the value of c so that the following is true.2 points0.10.30.50.7

Suppose Z follows the standard normal distribution. Use the calculator provided, or this table, to determine the value of c so that the following is true.=P≤−c≤Zc0.9715Carry your intermediate computations to at least four decimal places. Round your answer to two decimal places.

A normal random variable X has mean 5.6 and standard deviation 1.2. For which c> 0 does the equality P(-c≤x≤c) 0.9 hold? Round to two decimal places if needed.

A random variable X has a normal probability distribution N (0, 1). De-termine the value of c as a function of u and o such thatP (X ≥ c) = 9P (X < c).(a) Find the value of c.(b) Evaluate P ((X − µ)2 ≥ σ)

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.