type="text/javascript">

Sabtu, 22 Maret 2014

Titik Tengah

C++nya :
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int x1,x2,y1,y2,x,y;
    cout<<"Masukkan x1 = ";cin>>x1;
    cout<<"Masukkan x2 = ";cin>>x2;
    cout<<"Masukkan y1 = ";cin>>y1;
    cout<<"Masukkan y2 = ";cin>>y2;
    x=(x1+x2)/2;
    y=(y1+y2)/2;
    cout<<"Titik Tengah X = "<<"("<<x1<<"+"<<x2<<")/2="<<x;
    cout<<"      dan Y = ("<<y1<<"+"<<y2<<")/2 = "<<y;
    cout<<endl;
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

#Screenshot C++ nya :


#Screenshot Raptornya :

Tidak ada komentar:

Posting Komentar