Sort by

recency

|

3965 Discussions

|

  • + 0 comments

    i = 4 d = 4.0 s = 'HackerRank ' a=int(input()) b=float(input()) c=str(input()) print(f"{i+a}\n{b+d}\n{s+c}")

  • + 0 comments

    C# code: using System; using System.Collections.Generic; using System.IO;

    class Solution { static void Main(String[] args) { int i = 4; double d = 4.0; string s = "HackerRank ";

        // Declare second integer, double, and String variables.
        int userInt;
        double userDouble;
        string userString;
    
        // Read input for the declared variables.
        userInt = Convert.ToInt32(Console.ReadLine());       // Read an integer
        userDouble = Convert.ToDouble(Console.ReadLine());   // Read a double
        userString = Console.ReadLine();                     // Read a string
    
        // Perform the operations and print the results
        // Print the sum of integer variables
        Console.WriteLine(i + userInt);
    
        // Print the sum of double variables to one decimal place
        Console.WriteLine($"{d + userDouble:F1}");
    
        // Concatenate and print the strings
        Console.WriteLine(s + userString);
    
  • + 0 comments

    i = 4 d = 4.0 s = 'HackerRank ' a=int(input()) b=float(input()) c=str(input()) sum1=i+a double1=d+b print(sum1) print(double1) print(s+c)

  • + 0 comments

    Are you able to access the tutorials provided

  • + 0 comments

    For some reason in Java 15 the variables i, d, and s are not provided like they said. You have to include it on your own.

    Scanner user = new Scanner(System.in);
        int i = 4;
        double d = 4.0;
        String s = "HackerRank ";
    
        int z;
        double dec;
        String str;
    
        z = user.nextInt();
        dec = user.nextDouble();
        user.nextLine();
        str = user.nextLine();
    
        System.out.println(i + z);
        System.out.println(d + dec);
        System.out.println(s + str);