Saturday, May 2, 2015

STRUCTURE PROGRAM TO READ CO-ORDINATES OF THE END POINTS OF A LINE AND SHOW THE LENGTH


#include
struct tag
{
  int x,x1,y,y1;
};
void main()
{
 struct tag line;
 int len;
 clrscr();
 printf("\nEnter the coordinates (x,x1,y,y1):");
 scanf("%d%d%d%d",&line.x,&line.x1,&line.y,&line.y1);
 len=sqrt((line.x1-line.x)*(line.x1-line.x)+(line.y1-line.y)*(line.y1-line.y));
 printf("\nLength of the line=%d",len);
 getch();
 }

Related PostBlueJ Programs on Number

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner