Hello world problem solution HackerRank 30 Day of code

Hello world problem: In this post, we are going to solve HackerRank 30 days of code Hello world problem solution in java, python, javascript, swift, c, and c plus-plus programming language.

Hello world problem solution HackerRank 30 Day of code

Input Format

A single line of text denoting input string (the variable whose contents must be printed).

Output Format

Print Hello, World. on the first line, and the contents of the second line.

Hello, world program in the c programming language.

int main() {
    char inputString[105]; 
    scanf("%[^\n]", inputString); 
  
    printf("Hello, World.\n");

    printf("%s", inputString);

    return 0;
}

Hello, world program in the c++ programming language.


#include <iostream>

using namespace std;

int main() {
   string inputString; 
   getline(cin, inputString); 
   
   cout << "Hello, World." << endl;
   cout << inputString;

   return 0;
}

Hello, world program in the java programming language.

public class Solution {
   public static void main(String[] args) {
      Scanner scan = new Scanner(System.in); 
      String inputString = scan.nextLine(); 

      scan.close();
    
      System.out.println("Hello, World.");
      
      System.out.println(inputString);
   }
}

Hello, world program in the javascript programming language.

function processData(inputString) {
    console.log("Hello, World.");
    console.log(inputString);


Hello, world program in the swift programming language.

let inputString = readLine()! 
print("Hello, World.")
print(inputString)

Hello, world program in the vb.net programming language.

Imports System

Module Solution
    
    Public Shared Sub Main()
        ' Create a String variable:
        Dim greeting As String 

        ' Read value from stdin and save it to variable:
        greeting = Console.ReadLine() 

        ' Write "Hello, World." to stdout:
        Console.WriteLine("Hello, World.")
        
        ' Print variable to stdout:
        Console.WriteLine(greeting)
    End Sub
End Module

Hello, world program in the COBOL programming language.

PROGRAM-ID. APP.
AUTHOR. ABHIMANYU SINGH.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN ASSIGN TO KEYBOARD ORGANIZATION LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SYSIN.
01 ln PIC X(255).
88 EOF VALUE HIGH-VALUES.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
DISPLAY "Hello, World.".
DISPLAY ln
PERFORM UNTIL EOF      
READ SYSIN
AT END SET EOF TO TRUE
END-READ
END-PERFORM
CLOSE SYSIN
STOP RUN.

Hello, World program in the Python programming language

input_string = input()
print("Hello world")
print(input_string)


Post a Comment

0 Comments