Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class BooleanVariable
- {//Declare a Boolean variable called isFemale and assign an appropriate value corresponding to your gender.Print it on the console.
- static void Main()
- {
- bool isFemale = false;
- Console.Write("Are you a female? (Yes/No): ");
- String Answer = Console.ReadLine();
- if (Answer == "Yes")
- {
- isFemale = true;
- Console.WriteLine("You are female!");
- }
- else if (Answer == "No")
- {
- isFemale = false;
- Console.WriteLine("Yoy are Male!");
- }
- else
- {
- Console.WriteLine("Invalid Input");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment