Hi ,I think the follow program is right in logical But why the
compiler output :"square:declar ed identifier"
#include<stdio. h>
#include<math.h >
int main()
{
double x1;
double x2;
double y1;
double y2;
double x;
double y;
double distance;
printf("Enter the local of points: ");
scanf("%1f%1f%1 f%1f",&x1,&x2,& y1,&y2);
x=fabs(x1-x2);
y=fabs(y1-y2);
distance=sqrt(s quare(x)+square (y));
printf("The distance is %f",distance) ;
return 0;
}
compiler output :"square:declar ed identifier"
#include<stdio. h>
#include<math.h >
int main()
{
double x1;
double x2;
double y1;
double y2;
double x;
double y;
double distance;
printf("Enter the local of points: ");
scanf("%1f%1f%1 f%1f",&x1,&x2,& y1,&y2);
x=fabs(x1-x2);
y=fabs(y1-y2);
distance=sqrt(s quare(x)+square (y));
printf("The distance is %f",distance) ;
return 0;
}
Comment