We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 1: Data Types
Day 1: Data Types
Sort by
recency
|
3976 Discussions
|
Please Login in order to post a comment
//in c++
//in c
include
include
include
include
int main() { int i = 4; double d = 4.0; char s[] = "HackerRank "; int j; double k; char s1[100]; scanf("%d",&j); scanf("%lf",&k); getchar(); fgets(s1,sizeof(s1),stdin); printf("%d\n",i+j); printf("%.1lf\n",k+d); printf("%s%s\n",s,s1);
}
/* Declare second integer, double, and String variables. / int i2; double d2; String s2; / Read and save an integer, double, and String to your variables./ i2 = scan.nextInt(); d2 = scan.nextDouble(); scan.nextLine(); s2 = scan.nextLine(); / Print the sum of both integer variables on a new line. / System.out.println(i + i2); / Print the sum of the double variables on a new line. / System.out.println(d + d2); / Concatenate and print the String variables on a new line; the 's' variable above should be printed first. */ System.out.println(s.concat(s2));
Javascript solution for those whoo need help
{ // Predefined variables
}