Accept 3 integers as input and find the sum obtained by adding the first number with the greater out of the two remaining values.

#include <stdio.h>

int main(void)
{
int x, y, z, sum;

printf("\nEnter three numbers : ");
scanf("%d%d%d", &x, &y, &z);

if(y > z)
{
sum = x + y;
printf("\n%d + %d = %d", x, y, sum);
}
else
{
sum = x + z;
printf("\n%d + %d = %d", x, z, sum);
}

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin