QUESTION 44
Which of the following C code segments will print out the contents of the array k? Each segment has an important difference.
int i, k[5]={1,4,3,6,7};
for(i=0; i<5; i++)
printf("%f\n", k[i]);
int i, k[5]={1,4,3,6,7};
while(i < 5)
printf("%f\n", k[i]);
int i, k[5]={1,4,3,6,7
printf("%n", k);
int i, k[5]={1, 4, 3, 6, 7};
for(i = 0; i <=5; i++);
printf("%f\n", k[i]);
QUESTION 45
Given below is a partial C program that will read values into an array from an input file. A component of the fscanf() statement is missing. What is the missing component that will complete the statement?
int i, cost[10];
for(i = 0; i <= 9; i++)
f scanf(input, "%i", ?????);
• &cost(1)
• &cost[i]
O cost(i)
• cost[i+1]
QUESTION 46
What is the maximum number of array dimensions supported by the C programming language?
• Five
• It depends on your computer and compiler.
• Seven
• Six