Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  #include <stdio.h> int f(int b[], int m,int n) { int i,s=0; for(i=m;i<n;i+=2) s+=b[i] ; return s; } void main() { int x, a[]={1,2,3,4,5,6,7,8,9,10}; x=f(a,3,8); printf("%d\n",x); }
Language: C/C++
Code:
#include <stdio.h>
int f(int b[], int m,int n)
    { int i,s=0;
      for(i=m;i<n;i+=2) s+=b[i] ;   
  return s;
}
      void main()
     { int x, a[]={1,2,3,4,5,6,7,8,9,10};
       x=f(a,3,8);
       printf("%d\n",x);  
}
     
Comments: