skip to main | skip to sidebar

Sedikit Ilmu Yang Berguna

  • Entries (RSS)
  • Comments (RSS)
  • Home
  • About Us
  • Archives
  • Contact Us

Wednesday, March 23, 2011

algoritma menghitung titik tengah sebuah garis

Posted by randiadma at 4:56 PM
Buatlah algoritma dan program untuk mencari titik tengah sebuah garis yang ujung titiknya adalah A(x1,y1) dan B(x2,y2). 
 
masukkan nilai x1,x2,y1,y2 , lalu program menuliskan hasil x=(x1+x2)/2; menuliskan hasil y=(y1+y2)/2, menampilkan hasil x dan y 

#include <iostream.h>

int main()
{
float x, x1, x2, y, y1, y2;
cout << "titik x1 : ";cin >> x1;
cout << "titik x2 : ";cin >> x2;
cout << "titik y1 : ";cin >> y1;
cout << "titik y2 : ";cin >> y2;
x = (x1+x2)/2;
y = (y1+y2)/2;
cout << "titik tengah garis x1 dan x2 :"<<x<<endl;
cout << "titik tengah garis y1 dan y2 :"<<y<<endl;
cout << "titik tengah kedua garis antara (x1,y1) dengan (x2,y2):  ("<<x<<","<<y<<")"<<endl;


return 0;
}
Email This BlogThis! Share to X Share to Facebook

0 comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Sponsored

  • banners
  • banners
  • banners
  • banners

Blog Archive

  • ►  2012 (61)
    • ►  June (2)
    • ►  May (9)
    • ►  April (19)
    • ►  March (27)
    • ►  February (1)
    • ►  January (3)
  • ▼  2011 (44)
    • ►  December (2)
    • ►  November (11)
    • ►  October (1)
    • ►  September (5)
    • ►  May (1)
    • ►  April (16)
    • ▼  March (8)
      • hasil responsi semester 1
      • algoritma menghitung titik tengah sebuah garis
      • Algoritma memisahkan 3 bilangan integer
      • algoritma dan program untuk menghitung determinan ...
      • PROGRAM SEDERHANA
      • Tugas Algoritma
      • ALGORITMA PEMROGRAMAN
      • C ++

Followers

Clock Widgets

About Me

My photo
randiadma
Saya Mahasiswa UAD, Jurusan Teknik Informatika,
View my complete profile

My Fuckkn Facebook

Randy Mix Emax

Buat Lencana Anda

Followers

Powered by Blogger.

Blog Archive

  • ►  2012 (61)
    • ►  June (2)
    • ►  May (9)
    • ►  April (19)
    • ►  March (27)
    • ►  February (1)
    • ►  January (3)
  • ▼  2011 (44)
    • ►  December (2)
    • ►  November (11)
    • ►  October (1)
    • ►  September (5)
    • ►  May (1)
    • ►  April (16)
    • ▼  March (8)
      • hasil responsi semester 1
      • algoritma menghitung titik tengah sebuah garis
      • Algoritma memisahkan 3 bilangan integer
      • algoritma dan program untuk menghitung determinan ...
      • PROGRAM SEDERHANA
      • Tugas Algoritma
      • ALGORITMA PEMROGRAMAN
      • C ++
 

© 2010 My Web Blog
designed by DT Website Templates | Bloggerized by Agus Ramadhani | Zoomtemplate.com