You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-09-16 05:15:26
C Language Arrays And Strings Program Quiz:
C Programming Quizzes C Language Arrays And Strings
Directions:
Which of the following statements are correct about the program below?
Question:
#include<stdio.h>
void main()
{
int size, i;
scanf("%d", &size);
int arr[ size ];
for(i=1; i<=size; i++)
{
scanf("%d", arr[ i ]);
printf("%d", arr[ i ]);
}
}
Option A):
The code is erroneous since the statement declaring array is invalid
Option B):
The code is erroneous since the subscript for array used in for loop is in the range 1 to size
Option C):
The code is erroneous since the values of array are getting scanned through the loop
Option D):
The code is correct and runs successfully
Correct Answer is Option A):
The code is erroneous since the statement declaring array is invalid
Failure is the first step towards seccess.
Offline
2015-09-16 05:15:26
- Advertisement
- Ads By Google
Re: C Language Arrays And Strings Program Quiz:
\n