Numerology program
#include<stdio.h>
#include<string.h>
int recc(int);
void info();
int main(){
int val,y,total=0;
puts("Numerology\nEnter your name :");
char a[2003];
gets(a);
y = strlen(a);
//printf("length of string is %d\n\n",y);
printf("\nEntered name is %s\n\n",a);
for(int r=0;r<y;r++){
switch(a[r]){
case 'a':
case 'i':
case 'j':
case 'q':
case 'y':
case 'A':
case 'I':
case 'J':
case 'Q':
case 'Y':
val =1;
break;
case 'b':
case 'k':
case 'r':
case 'B':
case 'K':
case 'R':
val =2;
break;
case 'c':
case 'g':
case 'l':
case 's':
case 'C':
case 'G':
case 'L':
case 'S':
val =3;
break;
case 'd':
case 'm':
case 't':
case 'D':
case 'M':
case 'T':
val =4;
break;
case 'e':
case 'h':
case 'n':
case 'x':
case 'E':
case 'H':
case 'N':
case 'X':
val =5;
break;
case 'u':
case 'v':
case 'w':
case 'U':
case 'V':
case 'W':
val =6;
break;
case 'o':
case 'z':
case 'O':
case 'Z':
val =7;
break;
case 'f':
case 'p':
case 'F':
case 'P':
val =8;
break;
case ' ':
val =0;
break;
default:
printf("used others\n\n");
break;
}
total +=val;
}
//closed for loop
printf("total = %d\n\n",total);
if(total==11||total==22||total==33){
printf("your numerology number is %d\n",total);
info(total);
}
else{
int num=recc(recc(total));
printf("your numerology number is %d\n",num);
info(num);
}
return 0;
}
int recc(total){
int a=0;
if(total==0){
return 0;
} else{
a=total%10;
total=total/10;
return a+recc(total);
}
}
void info(number){
switch(number){
case 1:
printf("\nPersonality traits:\nIndependent\nAmbitious\n");
printf("Proactive\nPioneering\nInnovative\n");
printf("Self-centered\nUninhibited\nReckless\n");
printf("Motivated\nFreedom-loving\n");
break;
case 2:
printf("\nPersonality traits:\n");
printf("Tactful\nSensitive\nInfluential\n");
printf("Cooperative\nInclusive\nIntuitive\n");
printf("Supportive\nEmpathetic\nProtective\n");
break;
case 3:
printf("\nPersonality traits:\n");
printf("Artistic\nCommunicative\nCurious\n");
printf("Jovial\nScattered\nSocial\n");
printf("Optimistic\nNaïve\nYouthful\n");
break;
case 4:
printf("\nPersonality traits:\n");
printf("Strong\nTraditional\nPractical\n");
printf("Hard worker\nLoyal\nOrganized\n");
printf("Strict\nPatient\nDependable\n");
break;
case 5:
printf("\nPersonality traits:\n");
printf("Flexible\nAdventurous\nUnpredictable\n");
printf("Outgoing\nSocial\nRestless\n");
printf("Energetic\nIndependent\nInconsistent\n");
break;
case 6:
printf("\nPersonality traits:\n");
printf("Caring\nHealing\nCompassionate\n");
printf("Nurturing\nProtective\nIdealistic\n");
printf("Romantic\nWarm\nHarmonious\n");
break;
case 7:
printf("\nPersonality traits:\n");
printf("Perceptive\nIntellectual\nMysterious\n");
printf("Spiritual\nReserved\nSkeptical\n");
printf("Solitary\nIntrospective\nAnalytical\n");
break;
case 8:
printf("\nPersonality traits:\n");
printf("Accomplished\nBalanced\nGoal-oriented\n");
printf("Dedicated\nProsperous\nAuthoritative\n");
printf("Strong\nProfessional\nMaterialistic\n");
break;
case 9:
printf("\nPersonality traits:\n");
printf("Kind\nWise\nExperienced\n");
printf("Spiritual\nSacrificial\nCompassionate\n");
printf("Accepting\nHumanitarian\nAware\n");
break;
case 11:
case 22:
case 33:
printf("\nThese are having the unique ness\n");
break;
}
}