fork download
  1. #include <stdio.h>
  2. //#include <stdio.h>
  3. #include <string.h>
  4. #include <math.h>
  5. #include <stdlib.h>
  6.  
  7. int main() {
  8. int i = 4;
  9. double d = 4.0;
  10. char s[] = "HackerRank ";
  11.  
  12. // your code goes here
  13. int i1,sum1;
  14. double d1,sum2;
  15. char s1[50];
  16. // Read and save an integer, double, and String to your variables.
  17. //printf("enter values of int,double ans string variables\n");
  18. scanf("%d %lf %s",&i1,&d1,s1);
  19.  
  20. // Print the sum of both integer variables on a new line.
  21. sum1=i+i1;
  22. printf("%d\n",sum1);
  23.  
  24. // Print the sum of the double variables on a new line.
  25. sum2=d+d1;
  26. printf("%0.1lf\n",sum2);
  27.  
  28. // Concatenate and print the String variables on a new line
  29. // The 's' variable above should be printed first.
  30. strcat(s,s1);
  31. printf("%s\n",s);
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 9432KB
stdin
5
5.0
okay
stdout
9
9.0
HackerRank okay