fork download
  1. #include <stdio.h>
  2. void display(int a[],int n){
  3. for(int i=0;i<n;i++){
  4. printf("a[%d]=%d\n",i,*(a+i));
  5. }
  6. }
  7. int main(void) {
  8. // your code goes here
  9. int a[5]={1,2,3,4,5};
  10. int size=sizeof(a)/sizeof(a[0]);
  11. display(a,size);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
a[0]=1
a[1]=2
a[2]=3
a[3]=4
a[4]=5