Title: Hello, World! in 12 Programming Languages
Introduction:
In this post, I’ve shared the "Hello, World!" example in 12 different programming languages. Whether you're a beginner or someone looking to explore different languages, this can be a handy reference to get started with basic syntax!
- Java
public class Main { public static void main(String[] args) { System.out.println("Hello, world!"); } }
- Python
print("Hello, world!")
- C
#include <stdio.h> int main() { printf("Hello, world!\n"); return 0; }
- C++
#include <iostream> using namespace std; int main() { cout << "Hello, world!" << endl; return 0; }
- JavaScript
console.log("Hello, world!");
- C#
using System; class Program { static void Main() { Console.WriteLine("Hello, world!"); } }
- Ruby
puts "Hello, world!"
- Go
package main import "fmt" func main() { fmt.Println("Hello, world!") }
- Swift
print("Hello, world!")
- PHP
<?php echo "Hello, world!"; ?>
- HTML
<!DOCTYPE html> <html> <body> Hello, world! </body> </html>
- Kotlin
fun main() { println("Hello, world!") }
Conclusion:
These are just the simplest examples in each of these languages. If you’re just starting with a new language, this basic "Hello, World!" program is often your first step toward learning its syntax and structure.
You can also add tags like #programming, #code, #beginner, #java, #python, etc. to reach a wider audience.
😄
Top comments (0)