SHARE
TWEET

jarak

a guest Sep 12th, 2019 99 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. {
  6.     int x1;
  7.     int x2;
  8.     int y1;
  9.     int y2;
  10.     printf("Masukan nilai x1 : \n");
  11.     scanf("%d", &x1);
  12.     printf("Masukan nilai x2 : \n");
  13.     scanf("%d", &x2);
  14.     printf("Masukan nilai x1 : \n");
  15.     scanf("%d", &y1);
  16.     printf("Masukan nilai x1 : \n");
  17.     scanf("%d", &y2);
  18.     float jarak;
  19.     jarak = sqrt(x1-x2 * x1-x2 + y1-y2 * y1-y2);
  20.     printf("Jarak antara 2 titik %f\n", jarak);
  21.  
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top