Code Sample
•
code
Welcome to Code Sample!
// JavaScript example
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
// C# example
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
// Java example
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
// Rust example
fn main() {
println!("Hello, World!");
}
// Go example
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
/* CSS example */
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
h1 {
color: #333;
text-align: center;
}
# Python example
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
<!-- HTML example -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
-- SQL example
SELECT 'Hello, World!' AS Greeting;
# Ruby example
puts 'Hello, World!'