/*Copyright ElohimTov LLC*/ /* //Name: ElohimTov SolveCode - Data Types - C Solution //Problem: HackerRank - 30 Days of Code - Data Types //Current File: ElohimTovSolve_DataTypes.(c).txt //Compile-able File: ElohimTovSolve_DataTypes.c //Date: Created 05/21/2020; 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 #include int main() { int i = 4; double d = 4.0; char s[] = "HackerRank "; /* Declare second integer, double, and String variables. */ int i0; double d0; char s0[1000]; /* Read and save an integer, double, String to variables. */ scanf("%d", &i0); fgetc(stdin); scanf("%lf", &d0); fgetc(stdin); fgets(s0, 1000, stdin); /* Print the sum of both integer variables on a new line. */ int i_sum = i + i0; printf("%d\n", i_sum); /* Print the sum of the double variables on a new line. */ double d_sum = d + d0; printf("%.1f\n", d_sum); /* Concatenate and print the String variables on a new line */ /* The 's' variable above should be printed first. */ printf("%s%s\n", s, s0); return 0; }//main function /*Copyright ElohimTov LLC*/