Praktikum ke 5 madis

#include <cstdlib>
#include <iostream>

using namespace std;
double Absolut (double X ){ // definisi fungsi
if ( X < 0 ) X = -X; // fungsi memutlakna nilai
return(X);
}

int main(int argc, char *argv[])
{

float Nilai;
Nilai = – 123.45;

cout<<Nilai<<” Nilai mutlaknya adalah “<<Absolut(Nilai)<<endl;
double Absolut(double x);

system(“PAUSE”);
return EXIT_SUCCESS;
}

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s