/*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
g
the gender is female
Comments
Post a Comment