SUBMISSION LINK
https://www.hackerrank.com/contests/y16csecs/challenges/y16-subtraction-of-floating-poings
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
double a,b,c;
scanf("%lf %lf",&a,&b);
c=b-a;
if(c<0)
{
c=-c;
}
printf("%g",c);
return 0;
}
https://www.hackerrank.com/contests/y16csecs/challenges/y16-subtraction-of-floating-poings
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
double a,b,c;
scanf("%lf %lf",&a,&b);
c=b-a;
if(c<0)
{
c=-c;
}
printf("%g",c);
return 0;
}
Comments
Post a Comment