Sum and Difference of Two Numbers

  • + 0 comments
    int a,b;
    float c,d;
    int sum1, diff1;
    float sum2, diff2;
    scanf( " %d %d", &a,&b);
    scanf( " %f %f", &c,&d);
    sum1 = a+b;
    sum2 = c+d;
    diff1 = a-b;
    diff2 = c-d;
    printf( "%d %d \n", sum1,diff1);
    printf( "%.1f %.1f ", sum2,diff2);
    
    
    return 0;
    

    }