Hello World 1 using System; class HelloWorldProgram { static void Main(string[] args ){ // "printing Hello World" Console.WriteLine ("Hello, World!"); } }
Introduction to C# 2 using System; namespace HelloGeeksApp { class HelloGeeks { static void Main(string[] args ){ Console.WriteLine ("Hello Geek!"); Console.ReadKey (); } } }
Explanation Keywords using: lets you use classes from a namespace without full names. System: built-in namespace that has basic classes (like Console). namespace: groups related classes together (like a folder). class: defines a class (container for code). HelloGeeks : name of your class. static: method belongs to the class itself, no object needed. void: return type meaning “no value returned”. string[] args : stores command-line arguments (optional input). 3