-
Which of the following will be the correct output for the program given below ?
#include<stdio.h>
int main ( )
{
typedef int arr[ 5 ];
arr new_arr = {1, 2, 3, 4, 5 };
int k ;
for (k = 0; k < 4 ; k++)
printf("%d", new_arr[k] );
printf("\n");
return 0;
}
-
- 1 2 3 4
- 1 2 3 4 5
- No output
- Error: Cannot use typedef with an array
Correct Option: A
There is no error in the code. So output will be 1 2 3 4