GET I.T. DEPARTMENT FOR LESS GET I.T. DEPARTMENT FOR LESS GET I.T. DEPARTMENT FOR LESS GET I.T. DEPARTMENT FOR LESS GET I.T. DEPARTMENT FOR LESS GET I.T. DEPARTMENT FOR LESS
C Program To Predict The Gender of A Person With Name

Tag: C Program

C Program To Predict The Gender of A Person With Name
C Program To Predict The Gender of A Person With Name

This program predicts the gender of a person with his/her Name logic: This program compares the last characters of the string with names Program : #include<stdio.h> #include<string.h> int main() { char s[100],c; m: system(“cls”); b: printf(“enter the name (in lower case) :”); scanf(“%s”,s); if(strlen(s)>=3) { if(s[strlen(s)-1]==s[strlen(s)-2]) { printf(“nnenter a valid namenn”); goto b; } if(s[(strlen(s))-1]==’i’||s[(strlen(s))-1]==’u’||s[strlen(s)-1]==’a’||s[strlen(s)-4]==’d’||s[strlen(s)-1]==’i’) { printf(“nn%s is female”,s); }.. Read more