C# C# Basics If Statements "if" Statements

Chukwunonso Emmanuel
PRO
Chukwunonso Emmanuel
Pro Student 3,046 Points

C# if statements over 55

Program.cs
using System;

class Program
{

    static void CheckSpeed(double speed)
    {
        if(CheckSpeed < 55){
        Console.WriteLine("too fast");
        }
    }

    static void Main(string[] args)
    {
        // This won't print anything.
        CheckSpeed(53);
        // This should print "too fast".
        CheckSpeed(88);
    }

}

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,992 Points

The parameter is speed and you will want to check if it is greater than 55.