What is the output of C program with arrays.? int main() { int ary(3)=[20,30,40); printf("%d", a(t); } Option 1: 30 Option 2: Error Option 3: Option 4 20
Answers
Answered by
2
#include <stdio.h>
int main() {
int ary(3)=[20,30,40);
printf("%d",a(t));
return 0;
}
Error.
- The given code has two errors. First of all, array elements are written inside curly brackets. The size of the array must be written between [ and ] instead of ( ). Also there is no variable named 't' is declared. So, error occurs when you will try to execute the code.
Corrected Code:
#include <stdio.h>
int main() {
int ary[3]={20,30,40};
printf("%d",ary[1]);
return 0;
}
Output:
>> 30
Answered by
0
Answer:
Explanation:
What is the output of C program with arrays and pointers.? int main() { int a[3]-(20,30,40 ...
Similar questions