Sum and Difference of Two Numbers

Sort by

recency

|

630 Discussions

|

  • + 0 comments

    Sum and Difference of Two Numbers.

    Here is my Solution of the problem :

    #include <stdio.h>
    
    int main() {
    
        int frst, scnd;
        float thrd, frth;
    
        scanf("%d %d", &frst, &scnd);
        scanf("%f %f", &thrd, &frth);
    
        printf("%d %d\n", frst + scnd, frst - scnd);
        printf("%.1f %.1f\n", thrd + frth, thrd - frth);
    
        return 0;
    }
    
  • + 0 comments

    The sum represents the total when two numbers are added together, showing how quantities combine, while the difference represents the result of subtraction, showing how far apart two values are. Winbuzz ID Login

  • + 0 comments

    I wrote the code from scratch just to get more practice

    #include<stdio.h>
    
    int main()
    {
        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;
    }
    
  • + 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