Sunday, August 2, 2009

Create a program in C# using a switch to determine a gender M for Male F for Female?

I want if they enter that they are female and click the male doorbutton a message box will pop up and say wrong door and visa versa

Create a program in C# using a switch to determine a gender M for Male F for Female?
#include%26lt;stdio.h%26gt;


#include%26lt;conio.h





main()


{


char gender, f, m;


printf("If you are Female, type in the letter F.\nIf you are Male, type in the letter M");


scanf("%c", %26amp;gender);


switch(gender)


{


case f:


case F: printf("Female"); break;


case m:


case M: printf("Male"); break;


default: printf("There's only male and female on this planet");


}





getch();


return(0);


}





Hope this helps...'cause i'm not sure if this is really what you want...i don't really get your question actually


No comments:

Post a Comment