Sum and Difference of Two Numbers

  • + 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;
    }