URI ONLINE JUDGE SOLUTION 1007 - Difference

Problem:

Read four integer values named A, B, C and D. Calculate and print the difference of product A and B by the product of C and D (A * B - C * D).

Input

The input file contains 4 integer values.

Output


Print DIFERENCA (DIFFERENCE in Portuguese) with all the capital letters, according to the following example, with a blank space before and after the equal signal.

sample input output

Solution:

#include<stdio.h>
int main()
{
    int A,B,C,D,diff;
    scanf("%d%d%d%d",&A,&B,&C,&D);
    diff=(A*B)-(C*D);
    printf("DIFERENCA = %d\n",diff);
    return 0;

}

Comments

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula