18. C PROGRAM TO FIND GENDER OF A PERSON USING IF ELSE

/*C program to find gender of a person using if else*/

#include<stdio.h>
#include<conio.h>
int main()
{
char a;
printf(“enter the value of character”);
scanf(“%c”,&a);
if(a==’m’)
{
printf(“the gender is male”);
}
else
{
printf(“the gender is female”);
}
getch();
return 0;
}

output

output 1:
enter the value of character
m
the gender is male

output 2:
enter the value of character

the gender is female

Comments