Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats are parameters and arguments of a function?

function parameters
0
Posted

Whats are parameters and arguments of a function?

0

Arguments are used to pass information to a function. The expression f(10,2) calls the function f with two arguments, 10 and 2. Suppose we had a function int f(int m, int n) {return m – n*n ;} The function f has two parameters, m and n. When called, the parameter m is assigned the value 10 and n is assigned the value 2. The parameters m and n can be used just like local variables (see above) within the function f. Thus f(10,2) returns the value 6. I get crazy results with the sqrt and other math functions. Be sure to #include in your program. Also, make sure that other functions returning doubles are correctly defined. The compiler complains when I try to use the sqrt and other math functions. Depending on your setup, you may need to tell the compiler to use the math library, e.g., “gcc hello.c -lm”.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123