Sum and Difference of Two Numbers

  • + 0 comments

    int main() { int i_x; int i_y; float f_x; float f_y;

    scanf("%d %d", &i_x, &i_y);
    
    scanf("%f %f", &f_x, &f_y);
    
    int addInt = i_x + i_y;
    int diffInt = i_x - i_y;
    float addFloat = f_x + f_y;
    float diffFloat = f_x - f_y;
    
    printf("%d %d\n", addInt, diffInt);
    printf("%0.1f %0.1f\n", addFloat, diffFloat);
    
    return 0;
    

    }