Sum and Difference of Two Numbers

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