NextGen Dot Net Technologies

NextGen Dot Net Technologies blog will help you to get all the latest feature of .Net Framework/.Net Core(Including SQL Server). Apart of from Dot Net , This will explore you about Angular , Bootstrap and Azure. Feel free to give suggestions. Happy Learning. All the best.

Full width home advertisement

Asp.Net MVC World!!

Angular World!!!

Post Page Advertisement [Top]

Sample Input
12
4.0
is the best place to learn and practice coding!
Sample Output

16
8.0
Self Learning is the best place to learn and practice coding!
Explanation:
When we sum the integers  and , we get the integer 
When we sum the floating-point numbers  and , we get 
When we concatenate Self Learning with is the best place to learn and practice coding!, we get Self Learningis the best place to learn and practice coding!.


Solution:
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 iEntered = 0;
        double dEntered = 0.0;
        string sEntered = string.Empty;

        // Read and save an integer, double, and String to your variables.

        iEntered = Convert.ToInt32(Console.ReadLine());
        dEntered = Convert.ToDouble(Console.ReadLine());
        sEntered = Console.ReadLine();

        // Print the sum of both integer variables on a new line.
        Console.WriteLine(i+iEntered);       

        // Print the sum of the double variables on a new line.
        Console.WriteLine((d + dEntered).ToString("F1"));
        
        // Concatenate and print the String variables on a new line
        // The 's' variable above should be printed first.

        Console.WriteLine($"{s}{sEntered}");
  }

}

Happy Learning!!!!

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib