Advertisement
Joao_Joao

Questão 30 Lista de Exercícios IFPB

May 2nd, 2022
1,063
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.   double x1, y1;
  6.   double x2, y2;
  7.  
  8.   printf("Digite os valores de X e Y do ponto 1: ");
  9.   scanf("%lf %lf", &x1, &y1);
  10.  
  11.   printf("Digite os valores de X e Y do ponto 2: ");
  12.   scanf("%lf %lf", &x2, &y2);
  13.  
  14.   double distancia = sqrt(pow(x2-x1, 2) + pow(y2-y1, 2));
  15.  
  16.   printf("A distancia euclidiana entre os dois pontos eh: %lf\n", distancia);
  17.  
  18.   return 0;
  19. }
  20.  
Advertisement
RAW Paste Data Copied
Advertisement