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.
for getting all the test cases pass the code is like:
int main()
{
int a,b;
float c,d;
scanf("%d %d\n", &a, &b);
scanf("%f %f", &c, &d);
printf("%d %d\n", a+b, a-b);
printf("%.1f %.1f", c+d, c-d);
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sum and Difference of Two Numbers
You are viewing a single comment's thread. Return to all comments →
for getting all the test cases pass the code is like: int main() { int a,b; float c,d; scanf("%d %d\n", &a, &b); scanf("%f %f", &c, &d); printf("%d %d\n", a+b, a-b); printf("%.1f %.1f", c+d, c-d); }