It is supposed to tell me the occurrences of letters both upper and lower case and digit and non letter nor digits characters ,,but it does nothing ,,please help as soon as possible
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
int main(){
FILE *fp,*f2,*f3;
char ch,temp;
int i,j;
int lowercase[26]={0};
int upperCase[26]={0};
int digits[10]={0};
int nonLetterNordigit=0;
if((fp=fopen("myFile.txt","r+"))==NULL)
perror("openning file!");
f2=fp;
f3=fp;
//read char
//replace \n with '\0'
while((temp=fgetc(fp))!='\n'){
int ocurr=0;
//start from begining of file
f2=f3;
while((ch=fgetc(f2))!='\n'){
if(ch==temp)
++ocurr;
}
printf("%d\t",ocurr);
if(isalnum(temp) !=0){
if((isdigit(temp))!=0){
switch(temp){
case '0':
digits[0]=ocurr;
break;
case '1':
digits[1]=ocurr;
break;
case '2':
digits[2]=ocurr;
break;
case '3':
digits[3]=ocurr;
break;
case '4':
digits[4]=ocurr;
break;
case '5':
digits[5]=ocurr;
break;
case '6':
digits[6]=ocurr;
break;
case '7':
digits[7]=ocurr;
break;
case '8':
digits[8]=ocurr;
break;
case '9':
digits[9]=ocurr;
break;
default :
break;
}
} else if((islower(temp))!=0){
switch(temp){
case 'a':
lowercase[0]=ocurr;
break;
case 'b':
lowercase[1]=ocurr;
break;
case 'c':
lowercase[2]=ocurr;
break;
case 'd':
lowercase[3]=ocurr;
break;
case 'e':
lowercase[4]=ocurr;
break;
case 'f':
lowercase[5]=ocurr;
break;
case 'g':
lowercase[6]=ocurr;
break;
case 'h':
lowercase[7]=ocurr;
break;
case 'i':
lowercase[8]=ocurr;
break;
case 'j':
lowercase[9]=ocurr;
break;
case 'k':
lowercase[10]=ocurr;
break;
case 'l':
lowercase[11]=ocurr;
break;
case 'm':
lowercase[12]=ocurr;
break;
case 'n':
lowercase[13]=ocurr;
break;
case 'o':
lowercase[14]=ocurr;
break;
case 'p':
lowercase[15]=ocurr;
break;
case 'q':
lowercase[16]=ocurr;
break;
case 'r':
lowercase[17]=ocurr;
break;
case 's':
lowercase[18]=ocurr;
break;
case 't':
lowercase[19]=ocurr;
break;
case 'u':
lowercase[20]=ocurr;
break;
case 'v':
lowercase[21]=ocurr;
break;
case 'w':
lowercase[22]=ocurr;
break;
case 'x':
lowercase[23]=ocurr;
break;
case 'y':
lowercase[24]=ocurr;
break;
case 'z':
lowercase[25]=ocurr;
break;
default:
break;
}
}else if((isupper(temp))!=0){
switch(temp){
case 'A':
upperCase[0]=ocurr;
break;
case 'B':
upperCase[1]=ocurr;
break;
case 'C':
upperCase[2]=ocurr;
break;
case 'D':
upperCase[3]=ocurr;
break;
case 'E':
upperCase[4]=ocurr;
break;
case 'F':
upperCase[5]=ocurr;
break;
case 'G':
upperCase[6]=ocurr;
break;
case 'H':
upperCase[7]=ocurr;
break;
case 'I':
upperCase[8]=ocurr;
break;
case 'J':
upperCase[9]=ocurr;
break;
case 'K':
upperCase[10]=ocurr;
break;
case 'L':
upperCase[11]=ocurr;
break;
case 'M':
upperCase[12]=ocurr;
break;
case 'N':
upperCase[13]=ocurr;
break;
case 'O':
upperCase[14]=ocurr;
break;
case 'P':
upperCase[15]=ocurr;
break;
case 'Q':
upperCase[16]=ocurr;
break;
case 'R':
upperCase[17]=ocurr;
break;
case 'S':
upperCase[18]=ocurr;
break;
case 'T':
upperCase[19]=ocurr;
break;
case 'u':
upperCase[20]=ocurr;
break;
case 'V':
upperCase[21]=ocurr;
break;
case 'W':
upperCase[22]=ocurr;
break;
case 'X':
upperCase[23]=ocurr;
break;
case 'Y':
upperCase[24]=ocurr;
break;
case 'Z':
upperCase[25]=ocurr;
break;
default:
break;
}
}
}else
nonLetterNordigit=ocurr;
}
//print
fprintf(fp,"\n\n%s\n","a b c d e f g h i j k l m n o p q r s t u v w x y z ");
for(i=0;i<26;i++)
fprintf(fp,"%d ",lowercase[i]);
fprintf(fp,"\n");
fprintf(fp,"%s\n","A B C D E F G H I J K L M N O P Q R S T U V W X Y Z");
for(i=0;i<26;i++)
fprintf(fp,"%d ",upperCase[i]);
fprintf(fp,"\n");
fprintf(fp,"%s\n","0 1 2 3 4 5 6 7 8 9 ");
for(i=0;i<9;i++)
fprintf(fp,"%d ",digits[i]);
fclose(fp);
fclose(f2);
fclose(f3);
getch();
return 0;
}