#include <stdio.h>
#include <string.h>
//#define length 100
  
int main(void){
    char text[100];
	int begin,middle,end=0;
	int i=0, choice = 0;
	int j=0; 
	int count=0;
	int length =0;
	printf("Enter your word:\n ");
	for (i=0; i<100 && text[i-1]!='\n'; i++) scanf("%c", &text[i]);
	printf("%s",text);
	do{ 
		printf("\nEnter your choice: \n");
		printf("   1. Display number of occurences of each letter\n");
		printf("   2. Find whether the message is a palindrome\n");
		printf("   3. Quit\n");
		scanf("%d", &choice);
		//added by me
		//      printf (&choice);
		//end of added by me    
		while (text[length] !='\0' ) length++;
			  
		end = length -1;
		middle= length/2;
		
		for(begin = 0 ; begin < middle ; begin++ ){
			switch (choice){
				case 1:
					for(j=0; j < i; j++){
						if((text[j]>='a' && text[j]<='z') || (text[j]>='A' && text[j]<= 'Z')) count++;
						else continue;
					}
					break;
               
				case 2:
					if (text [begin] != text[end] ) {
						printf("Not a palindrome.\n");
						break;
					}
					end--;

					if( begin == middle )printf("Palindrome.\n");
					break;
				//added by me
				case 3:
					exit(0);
				//end of added by me
        
			}
		}
	} while (choice != 3);   
	return 0;
}