{ return 0; } { int i, j = 1; for(i=1; i<=m; i++) j=j*i; return j; } float xyz(f
ID: 3705496 • Letter: #
Question
{
return 0;
}
{
int i, j = 1;
for(i=1; i<=m; i++)
j=j*i;
return j;
}
float xyz(float v, int k)
{
int i;
float w = 1.0;
for(i=1; i<=k; i++; w*=v);
return(w);
}
When the program is completed, the value of b is __________ and the value of y is __________.
2. Complete the following sentence: If you declare an array to hold N values, legal subscripts run from _____ to ______.
3. Complete the following sentence: the unsubscripted name of an array is _______________________________.
int main()
{
int a = 3, b;
float x = 2.0, y;
b = abc(a);
y = xyz(x, a);
return 0;
}
int abc(int m)
{
int i, j = 1;
for(i=1; i<=m; i++)
j=j*i;
return j;
}
float xyz(float v, int k)
{
int i;
float w = 1.0;
for(i=1; i<=k; i++; w*=v);
return(w);
}
Explanation / Answer
1.
b = 6
i = 1, j = 1
i = 2, j = 2
i = 3, j = 6
return 6
y = 8.0
i = 1, w =2.0
i = 2, w = 4.0
i = 3, w = 8.0
return w
2. 0 to N-1
3. address of the array
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.