With respect to the following code:int f(int a, char b, double *p) { return a + b + (int) *p;}int main() { int x; char b; double d, *dp; dp = &d; x = f(x, b, dp); return 1;}Match the pairsreturn typeAnswer 1Formal ParametersAnswer 2Parameter ProfileAnswer 3prototypeAnswer 4Actual ParametersAnswer 5Name of functionAnswer 6SignatureAnswer 7
Question
With respect to the following code:int f(int a, char b, double *p) { return a + b + (int) *p;}int main() { int x; char b; double d, *dp; dp = &d; x = f(x, b, dp); return 1;}Match the pairsreturn typeAnswer 1Formal ParametersAnswer 2Parameter ProfileAnswer 3prototypeAnswer 4Actual ParametersAnswer 5Name of functionAnswer 6SignatureAnswer 7
Solution 1
Sure, here are the pairs:
- Return type: int
- Formal Parameters: int a, char b, double *p
- Parameter Profile: int, char, double*
- Prototype: int f(int a, char b, double *p)
- Actual Parameters: x, b, dp
- Name of function: f
- Signature: f(int, char, double*)
Solution 2
Sure, here are the pairs:
- Return type: int
- Formal Parameters: int a, char b, double *p
- Parameter Profile: int, char, double*
- Prototype: int f(int a, char b, double *p)
- Actual Parameters: x, b, dp
- Name of function: f
- Signature: f(int, char, double*)
Similar Questions
With respect to the following code:int f(int a, char b, double *p) { return a + b + (int) *p;}int main() { int x; char b; double d, *dp; dp = &d; x = f(x, b, dp); return 1;}Match the pairsreturn typeAnswer 1Formal ParametersAnswer 2Parameter ProfileAnswer 3prototypeAnswer 4Actual ParametersAnswer 5Name of functionAnswer 6SignatureAnswer 7
Mark statements as T/F.True False int *p, i;char *cp, c;p = &i;cp = (char *)p;cp[2] = 'x';The last line of the above code modifies the variable i int *p; double *dp;sizeof(p) is 4 bytes while sizeof(dp) is 8 bytes. int *p;p[1] means *(p + 1) int *p; double *dp;p = p + 1 advances p by sizeof(int) bytes
What does the following program print?void f(int *p, int *q) { p = q; *p = 2;}int i = 0, j = 1;int main() { f(&i, &j); printf("%d %d \n", i, j); getchar(); return 0;}Options2 22 10 10 2
What is the output of the following C code:#include <stdio.h>void fun(int **p);int main(){ int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 8, 7, 8, 9, 0}; int *ptr; ptr = &a[0][0]; fun(&ptr); return 0;}void fun(int **p){ printf("%d\n", **p);}1234
What will be the output of the following code?int main() { int a = 10; int *p = &a; *p = 20; printf("%d\n", a); return 0;}
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.