Sum and Difference of Two Numbers

Sort by

recency

|

627 Discussions

|

  • + 0 comments

    include

    include

    include

    include

    int main() { int x,y; float m,n; scanf("%d %d",&x,&y); scanf("%f %f",&m,&n); if(x>=1 && x<=10000 && y>=1 && y<=10000 && m>=1 && m<= 10000 && n>= 1 && n<=10000) { printf("%d %d\n",x+y,x-y); printf("%.1f %.1f",m+n,m-n); } else { return 0; } return 0; }

  • + 0 comments

    solve

  • + 0 comments

    include

    include

    include

    include

    int main() { int a,b; float x,y; scanf("%d %d",&a, &b); scanf("%f%f",&x, &y); printf("%d %d\n", a + b, a - b); printf("%.1f %.1f\n", x + y, x - y);

    return 0;
    

    }

  • + 0 comments

    Here is HackerRank Sum and Difference of Two Numbers C solution

  • + 0 comments

    include

    int main() { int a = 10; int b = 4; float x = 4.0; float y = 2.0; printf("%d %d\n", a+b, a-b); printf("%.1f %.1f ",x+y ,x-y);

    return 0;
    

    }