top of page
Search
Writer's pictureAhum Maitra

'Hello word' text in different programming languages

Here's how to write "Hello, World!" in various programming languages and technologies:


### 1. Python

```python

print("Hello, World!")

```


### 2. C

```c

#include <stdio.h>


int main() {

printf("Hello, World!\n");

return 0;

}

```


### 3. C++

```cpp

#include <iostream>


int main() {

std::cout << "Hello, World!" << std::endl;

return 0;

}

```


### 4. C#

```csharp

using System;


class Program

{

static void Main()

{

Console.WriteLine("Hello, World!");

}

}

```


### 5. Objective-C

```objectivec

#import <Foundation/Foundation.h>


int main(int argc, const char * argv[]) {

@autoreleasepool {

NSLog(@"Hello, World!");

}

return 0;

}

```


### 6. SQL (MySQL)

```sql

SELECT 'Hello, World!';

```


### 7. MongoDB (JavaScript-based shell)

```javascript

print("Hello, World!");

```


### 8. HTML

```html

<!DOCTYPE html>

<html>

<head>

<title>Hello World</title>

</head>

<body>

<h1>Hello, World!</h1>

</body>

</html>

```


### 9. CSS (Using `content` property in pseudo-elements)

```css

body::before {

content: "Hello, World!";

display: block;

font-size: 24px;

}

```


### 10. JavaScript

```javascript

console.log("Hello, World!");

```


### 11. PHP

```php

<?php

echo "Hello, World!";

?>

```


### 12. Java

```java

public class HelloWorld {

public static void main(String[] args) {

System.out.println("Hello, World!");

}

}

```


### 13. Ruby

```ruby

puts "Hello, World!"

```


### 14. Swift

```swift

print("Hello, World!")

```


### 15. Kotlin

```kotlin

fun main() {

println("Hello, World!")

}

```


### 16. Bash (Shell script)

```bash

echo "Hello, World!"

```


### 17. Perl

```perl

print "Hello, World!\n";

```


### 18. Go

```go

package main


import "fmt"


func main() {

fmt.Println("Hello, World!")

}

```


### 19. R

```r

cat("Hello, World!\n")

```


### 20. Rust

```rust

fn main() {

println!("Hello, World!");

}

```


### 21. Scala

```scala

object HelloWorld {

def main(args: Array[String]): Unit = {

println("Hello, World!")

}

}

```


### 22. Haskell

```haskell

main = putStrLn "Hello, World!"

```


### 23. MATLAB

```matlab

disp('Hello, World!')

```


### 24. Lua

```lua

print("Hello, World!")

```


### 25. Assembly (x86)

```assembly

section .data

hello db 'Hello, World!',0


section .text

global _start


_start:

mov edx, 13 ; message length

mov ecx, hello ; message to write

mov ebx, 1 ; file descriptor (stdout)

mov eax, 4 ; system call number (sys_write)

int 0x80 ; call kernel


mov eax, 1 ; system call number (sys_exit)

int 0x80 ; call kernel

```


### 26. Pascal

```pascal

program HelloWorld;

begin

writeln('Hello, World!');

end.

```


### 27. TypeScript

```typescript

console.log("Hello, World!");

```


### 28. Fortran

```fortran

program hello

print *, 'Hello, World!'

end program hello

```


### 29. COBOL

```cobol

IDENTIFICATION DIVISION.

PROGRAM-ID. HELLO-WORLD.

PROCEDURE DIVISION.

DISPLAY 'Hello, World!'.

STOP RUN.

```


### 30. SQL (PL/SQL)

```sql

BEGIN

DBMS_OUTPUT.PUT_LINE('Hello, World!');

END;

```


These examples cover a wide range of programming languages and technologies, each with a simple "Hello, World!" output.

1 view0 comments

Recent Posts

See All

Comments


bottom of page