sum and difference code

–1 vote
asked Aug 6 by (110 points) 1 flag

2 Answers

0 votes
answered Aug 9 by (1,600 points)
Could you please explain a little what you would like to do?
0 votes
answered Aug 12 by (140 points)
/**********IN C**********/

#include<stdio.h>

int main()

{

int x,y,sum,difference;

printf("Enter values for x,y\n");

scanf("%d %d",&x,&y);

sum=x+y;

if(x>y)

{

difference=x-y;

}

else

{

difference=y-x;

}

printf("sum=%d\tdifference=%d",sum,difference);

return 0;

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...