title: A string is said to be lucky if the sum of the ascii values in the string is even.int funcname(char *a) should be used
body: <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  int checklucky(char *a);
  int iseven(int sum);
  int sum(char *a);
  
  int iseven(int sum)
  {
     int fin;
     if((sum/2)==0)
        fin=1;
     return fin;
  }
  
  int add(char *a)
  {
     int i=0,sum=0;
     int len=strlen(a);
     for(i=0;i&lt;len;i++)
     {
        sum=sum+a[i];
     }
     return sum;
  }
  
  int checklucky(char *a)
  {
     return iseven(add(a));
  }
  
  int main(int argc,char** argv)
  {
     char a[100];
     int lucky;
     printf("Enter the input string");
     scanf("%s",a);
     lucky=checklucky(a);
     printf("%s %s lucky\n",a,(lucky==1 ?"is":"is not"));
     return 0;
  }
  </code></pre>
  
  <p>The inputs which i give prints only "is not" lucky for all strings.If the sum of ascii values of my strings are even, it should print the given string is lucky else the given string is not lucky. please help me.</p>