Sum and Difference of Two Numbers

Sort by

recency

|

606 Discussions

|

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

    hi

  • + 0 comments

    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);

  • + 0 comments

    Hello

  • + 0 comments

    include

    include

    include

    include

    int main() { int a,b; float c,d;

    printf("enter number a:");
    scanf("%d",&a);
    
    printf("enter number b:");
    scanf("%d",&b);
    
    printf("enter number c:");
    scanf("%f",&c);
    
    printf("enter number d:");
    scanf("%f",&d);
    
    printf("%d %d",a+b,a-b);
    printf("\n%.1f %.1f",c+d,c-d);
    
    
    return 0;
    

    }