Compare int value in if statement - CSharp Language Basics

CSharp examples for Language Basics:if

Description

Compare int value in if statement

Demo Code

class score//from  www  .  j a  va 2s.c o m
{
    public static void Main()
    {
        int score = 99;
        if (score == 100)
        {
            System.Console.WriteLine("You got a perfect score!");
        }
        else
            System.Console.WriteLine("Bummer, you were not perfect!");
    }
}

Result


Related Tutorials