Sum and Difference of Two Numbers

Sort by

recency

|

619 Discussions

|

  • + 0 comments
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>
    
    int main()
    {
    	int a,b;
        float x,y;
        scanf("%d %d\n%f %f",&a,&b,&x,&y);
        printf("%d %d\n%.1f %.1f",a+b,a-b,x+y,x-y);
        return 0;
    }
    
  • + 0 comments

    int a,b; float c,d; scanf("%d %d", &a,&b); scanf("%f %f",&c,&d); printf("%d %d\n", a+b, a-b); printf("%.1f %.1f", c+d, c-d); return 0;

    1 means one, not i or L

  • + 0 comments

    Here is Sum and difference of two numbers solution in c - https://programmingoneonone.com/hackerrank-sum-and-difference-of-two-number-solution-in-c.html

  • + 0 comments

    its simplicity, speed, and close-to-hardware control make it essential for systems programming. Mostbet

  • + 0 comments

    include

    int main() { int a,b; float c,d; scanf("%d %d\n%f %f",&a,&b,&c,&d); printf("%d %d\n%.1f %.1f",a+b ,a-b,c+d,c-d);
    return 0; }