Sum and difference of any two integer numbers as well as two floating numbers.

 SOURCE CODE:

#include <stdio.h>

int main()

{

    int a,b;

    float c,d;

  scanf("%d\n",&a);

    scanf("%d",&b);

    printf("%d",a+b);

    printf(" %d\n",a-b);

    scanf("%f\n",&c);

    scanf("%f",&d);

    printf("%0.1f",c+d);

    printf(" %0.1f\n",c-d);

    return 0;

}


INPUT:



OUTPUT:


















Comments

Post a Comment