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
int main() {
printf("Hello, world!\n");
return 0;
}
- C++
#include
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
- HTML
Hello, world!
Enter fullscreen mode
Exit fullscreen mode
Kotlin
fun main() {
println("Hello, world!")
}
Enter fullscreen mode
Exit fullscreen mode
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.😄