/*Copyright ElohimTov LLC*/ /* //Name: ElohimTov SolveCode - Data Types - C++ Solution //Problem: HackerRank - 30 Days of Code - Data Types //Current File: ElohimTovSolve_DataTypes.(cpp).txt //Compile-able File: ElohimTovSolve_DataTypes.cpp //Date: Created 10/25/2018; 12/31/2021. //Tale: ElohimTov Solve's Solution to HackerRank.com's // Data Types problem in C++ programming language. // Problem link at https://elohimtov.com/elohimtov.info. */ #include #include #include using namespace std; int main() { int i = 4; double d = 4.0; string s = "HackerRank "; /* Declare second integer, double, and String variables. */ int i1 = 0; double d1 = 0; string s1 = ""; /* Read and save an integer, double, and String to your variables. */ cin >> i1 >> d1; getline(cin, s1); getline(cin, s1); /* Print the sum of both integer variables on a new line. */ cout << i + i1 << endl; /* Print the sum of the double variables on a new line. */ printf("%1.1f \n", (d + d1)); /* Concatenate and print the String variables on a new line */ /* The 's' variable above should be printed first. */ cout << s + s1 << endl; return 0; }// ends main function /*Copyright ElohimTov LLC*/