i am trying to compare my array containing month name like "dec" "jan" etc with the string "dec" using strcmp function but its not working the program purpose is to sum the date like, 12 dec 2018 the result should display the sum as 1+2 + 1+2 + 2+0+1+8=17
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(){
int i=0,j=0,k=0,sum=0,x1=0,x2=0;
char a[15],b[3]
printf("Enter String [Date] :");
gets(a);
for(i=0;a[i]!='\0';i++){
if(a[i]>=48 && a[i]<=57){
for(j=0;j<=9;j++){
if(a[i]==j+48)
sum=sum+j;
}
}
else if( (a[i]>=65 && a[i]<=90) || (a[i]>=97 && a[i]<=122 ) ){
b[k]=a[i];
k++;
}
}
printf("\n%d\n",sum);
for(i=0;i<=2;i++)
printf("%c",b[i]);
if(strcmp(b,"dec")==0){
x1=1;
x2=2;
printf("\n%d%d",x1,x2);
}
}