Sort by

recency

|

3989 Discussions

|

  • + 0 comments

    agreed on confunsing wording

    python3

    if __name__ == '__main__':
        i = int(4)
        d = float(4.0)
        s = str('HackerRank')
        
        a = int(input().strip())
        b = float(input().strip())
        c = str(input().strip())
        
        print(i+a)
        print(b+d)
        print(s, c)
    
  • + 0 comments

    I don't know if it's just me but the wording was super confusing.

  • + 0 comments

    in C# this works

      // Declare second integer, double, and String variables.
        int secondInteger;
        double secondDouble; 
        string secondText;
    
        // Read and save an integer, double, and String to your variables.
         secondInteger = int.Parse(Console.ReadLine());
         secondDouble = double.Parse(Console.ReadLine());
         secondText = Console.ReadLine();
    
        // Print the sum of both integer variables on a new line.
        Console.WriteLine(secondInteger+i);
    
        // Print the sum of the double variables on a new line.
        double var3 = secondDouble+d;
         Console.WriteLine(var3.ToString("F1"));
    
        // Concatenate and print the String variables on a new line
        // The 's' variable above should be printed first.
        Console.WriteLine(s+""+secondText);
    
    
    }
    
  • + 0 comments

    here is Day 1 data types solution in python, java, c++, c and javascript - https://programmingoneonone.com/hackerrank-day-1-data-types-30-days-of-code-solution.html

  • + 1 comment

    The task says:

    The variables i d and s are already declared and initialized for you.

    But this is not true, You'll need to create and initalise them yourself to pass.

    Eg:

    const i: number = 4;
    const d: number = 4.0;
    const s: string = "HackerRank"
    

    `