A defined function has a return value. Function calls can be used as formal parameters of a function? If a defined function has a return value, the error in the following description of the function call is d A) Function calls can exist as separate statements B) Function calls can be used as arguments to a function C) Function calls can appear in expressions D) Function calls can be used as formal parameters of a function Many of the answers come from D!
D) Function calls can be used as formal parameters of a function
The return value exists in the register without address and cannot be used as a formal parameter
RELATED INFORMATIONS
- 1. Define the function Total (n), calculate 1 + 2 + 3 +... + N, the function return type is int In the main function input positive integer n, call the function Total (n) to calculate and output the value of the following formula S=1+1/(1+2)+1/(1+2+3)+...+1/(1+2+3+...+n) My answer is: #include int total(int x) { int z=0; for(;x>0;x--) z=z+x; return z; } void main() { int n; double a; a=0; Printf ("please enter a positive integer n / N"); scanf("%d",&n); for(;n>0;n--) a=a+1/total(n); printf("%lf\n",a); } Then the output result should be the wrong data type
- 2. If a single variable polynomial is represented by a circularly linked list, try to write a function Calc (x) to calculate the value of the polynomial at X #include //#include using namespace std; class polynomial { public: float coef; int exp; polynomial *next; //void count(polynomial *p,int x); }; int main() { void count(polynomial *p,int x); // string str; polynomial *p; p=new polynomial; int e; float c; polynomial *q,*r; q=p; r=p; // coutexp=e; r->next=q; r=q; } // cout>x; count(p,x); return 0; } void count(polynomial *p,int x) { float c; int e; int f=1; float num=0; polynomial *k,*m; k=p; m=p; while(k!=m) { c=k->coef; e=k->exp; p=k->next; k=p; if(e>=1) { for(e;e>0;e--) { f=x*f; num+=c*f; } f=1; } if(e==0) num+=c; if(e
- 3. double fact(int n) { if (n==0) return 1; else return n*(fact(n-1)); }
- 4. Why do mathematicians stipulate that the factorial of 0 is 1?
- 5. Now there are seven kinds of gifts, which are simply divided into first class, second class Seventh class It is stipulated that five equal gifts can be exchanged for one higher class gift (five first class gifts can be exchanged for one second class gift; five second class gifts can be exchanged for one third class gift...) But every time you change it, you have to charge 11000 Ask someone if they have enough first class gifts If he wants to exchange a second-class gift, how many first-class gifts do he need? How many times? How much is the handling charge? If he wants to exchange a third-class gift, how many first-class gifts do he need? How many times? How much is the handling charge? If he wants to exchange a fourth-class gift, how many first-class gifts do he need? How many times? How much is the handling charge? If he wants to exchange a fifth class gift, how many first class gifts do he need? How many times? How much is the handling charge? If he wants to exchange a sixth class gift, how many first class gifts do he need? How many times? How much is the handling charge? If he wants to exchange a seventh class gift, how many first class gifts do he need? How many times? How much is the handling charge? Can you provide it
- 6. Prove 1p1 + 2 * (2P2) + 3 * (3p3) +. + n * (NPN) = (n + 1) P (n + 1) - 1
- 7. 40-32 △ 2 is the factorial of 4
- 8. What is the sum of the factorials of 4 and 5? What is the sum of factorials? My question is: what is the sum of factorials of 1-4, and what is the sum of factorials of 1-5?
- 9. 2 4 7 13 factorial calculation 24
- 10. Let n be a natural number, n! = 1 * 2 * 3 *... * (n-1) * n be called the factorial of N, and 0! = 1. Try to write a program to calculate 2, 4, 10! And output the result This problem is java programming!
- 11. It is required to define a function named mysum with a return value of double type. Its function is to find the sum of the number of two double types A) mysum(double a,b) { return (a+b); } B) mysum(double a,double b) { return a+b; } C) double mysum(int a,intb); {return a+b; } D) double mysum(double a,double b) { retrun (a+b); } What is the correct answer and why? I see. I didn't see the title "finding the sum of two double type numbers". Now the question is what type is the return value of B? Do you have to write the brackets of return (a + b)? C linguistics is not good, there are many fuzzy places
- 12. The factorial of minus one? It's when I solve the problem, that means I'm wrong,
- 13. On factorial If (2n)! = 2x4x6x Why not just write (2n)!, these two are not the same? Or n!
- 14. 24 points of 9 5 7 5 (factorial)
- 15. How many zeros are there at the end of the factorial of 100?
- 16. The reason why the factorial of 0 is 1 In my opinion, it is inappropriate for some people to deduce 0! = 1 by using the factorial recurrence formula The premise of recurrence formula n! = n * (n-1)! Is n > 1, so it is wrong to substitute 1 to get 0! = 1 Factorial is defined as n! = 1 * 2 * 3 *. * n or n! = n *. * 3 * 2 * 1, starting from or ending at 1 So 1! = 1 * 1 and not equal to 1 * 0! =In the permutation formula, P = n! / (m-n)! In order to make the equation hold when m = n, the denominator cannot be 0, so 0! = 1 is specified. Moreover, we know that there is only one way to take n elements from n elements, so it can only be specified equal to 1, not equal to 2, 3 The last sentence is wrong. There are n! Ways to take n elements from n non primes, so p = n, so 0! = 1 cannot be equal to 2,3
- 17. Why is 0 factorial 1,1 factorial 1,2 factorial 2?
- 18. How many zeros are there at the end of the factorial of 25?
- 19. How many consecutive zeros are there at the end of the factorial in 2013?
- 20. How many zeros are there at the end of the factorial of 35? 35*34*33…… *3 * 2 * 1 the answer is 8,