Skip to content

Instantly share code, notes, and snippets.

@BrendanJ
Created November 1, 2014 03:38
Show Gist options
  • Save BrendanJ/efdf3014567e2470e89c to your computer and use it in GitHub Desktop.
Save BrendanJ/efdf3014567e2470e89c to your computer and use it in GitHub Desktop.
C code 1
#include <stdio.h>
#include <math.h>
int
main()
{
double xvalue, yvalue, abs_diff;
printf("Enter X Value: ");
scanf("%lf", &xvalue);
printf("Enter Y Value: ");
scanf("%lf", &yvalue);
abs_diff = (fabs(xvalue) - (fabs(yvalue)));
printf("The absolute difference is %2.2f\n", abs_diff);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment