Reginaldojs

exercicio 38,lista 1

Aug 31st, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. #include<stdlib.h>
  4. int main () {
  5.     float a,b,c,d,dist=0;
  6.     printf("digite o primeiro ponto:");
  7.     scanf("%f",&a);
  8.     printf("o segundo:");
  9.     scanf("%f",&b);
  10.     printf("o terceiro:");
  11.     scanf("%f",&c);
  12.     printf("por fim,o ultimo ponto:");
  13.     scanf("%f",&d);
  14.     dist=sqrt(pow(b-a,2)- pow(d-c,2));
  15.     printf("A distancia entre estes pontos sera %.0f\n\n",dist);
  16.     system("pause");
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment