Skip to content

Instantly share code, notes, and snippets.

@jpetto
Created September 18, 2012 19:11
Show Gist options
  • Save jpetto/3745157 to your computer and use it in GitHub Desktop.
Save jpetto/3745157 to your computer and use it in GitHub Desktop.
MJ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicationQuiz1
{
class Program
{
static void Main(string[] args)
{
// ask the user what number jordan wore
Console.WriteLine("So, what number did MJ wear?");
// get input from the user
// declare a variable to hold user input
string strAnswer;
// retrieve input from console
strAnswer = Console.ReadLine();
// convert user string input to an integer
int intAnswer = int.Parse(strAnswer);
// branching statement to respond to the user's answer
if ((intAnswer == 23) || (intAnswer == 45))
{
Console.WriteLine("Damn right!");
}
else
{
Console.WriteLine("Move away from Chicago immediately.");
}
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment