Sort by

recency

|

3988 Discussions

|

  • + 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

  • + 0 comments

    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"
    

    `

  • + 1 comment

    This is correct code but still icant figure it out why do we taken that i & d as 4 can anybody** help me **with that .

        int i = 4;
        double d = 4.0;
        String s = "HackerRank ";
    
        Scanner scan = new Scanner(System.in);
    
        int i2 = scan.nextInt();      
        double d2 = scan.nextDouble();
        scan.nextLine();              
        String s2 = scan.nextLine();  
    
    
        System.out.println(i + i2);
        System.out.printf("%.1f\n", d + d2);
        System.out.println(s + s2);
    
        scan.close();
    }
    

    }