In the task, we need to print the message “Hello World!”.
We print the message “Hello World!” using the printf function.
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}We print the message “Hello World!” using the puts function. The puts function always ends the text output with a newline character (\n).
#include <stdio.h>
int main(void)
{
puts("Hello World!");
return 0;
}We print the message “Hello World!” using the System.out.println function.
import java.util.*;
public class Main
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}We print the message “Hello World!” using the print function.
print("Hello World!")package main
import "fmt"
func main() {
fmt.Println("Hello World!");
}using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleAppCSharp
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello World!");
}
}
}puts "Hello World!"fn main() {
println!("Hello World!");
}main = putStrLn "hello world"