Quick actions

cmd+k|ctrl+k

Navigation

Languages

Variables

Snippet info

Language

Csharp

Visibility

public

Author

planet.code.seeds

Created

2025-02-15T17:45:40.969985Z

Updated

2025-02-18T21:34:12.068542Z

using System;
using System.Collections.Generic;
using System.Linq;

class MainClass {
    static void Main() {
        
        // declaring and initializing valid variables
        int age = 25;
        float distance = 9.81f;
        double speed = 19.99999;
        decimal balance = 1000.50m;
        bool isActive = true;
        char letter = 'A';
        string name = "John";
        
        // declare a variable and then assign it
        string greeting;
        greeting = "Hello";
        
        // invalid variable name (this will produce an error)
        // remeber variables cannot start with a number
        // erase the 1 to make it work
        string 1day = "Monday";
        
        // you can reassign a variable as many times as you'd like
        greeting = "Hello, how are you";
        
        // write the greeting to stdout (standard output)
        Console.WriteLine(greeting);
    }
}
INFO