0
Why i didn't get the output for this c program in arrays?
#include<stdio.h> int main() { long long int n,a[n]; int i; for(i=0;i<n;i++) { printf("enter the element for index number:=%d\n",i); scanf("%lld",&a[i]); } for(i=0;i<n;i++) { printf("The element at index %d=%lld\n",i,a[i]); } return 0; }
8 Respostas
+ 3
Rajulapudi Aswini
Where did you take input n?
+ 2
Rajulapudi Aswini
long long int n;
scanf ("%lld", &n);
long long int a[n];
+ 2
Rajulapudi Aswini
Update your code and take input like this:
2 //which is number of elements
2
3
And above are two elements
0
I code for infinite number of inpuuts..So i called it as n
0
Can you make a code for n inputs and explain?
0
Thank you,But i didn't get the output.
0
Please put C-Language in the tags above ☝