Friday, November 30, 2012

Tutorial Bahasa Pemrograman C++ - Modul 3 OERATOR (Bagian 1)

Berikut adalah Tugas saya, yaitu Tutorial Bahasa Pemrograman C++ yang membahas Modul 3 yaitu pembahasan Operator ( Bagian 1). Disini kita membahasa tentang Operator Assigment, Operator Unary, Increment, dan Decrement.


Source Code Program  Operator Assigment :

//Modul 3-1
//Operator Assignment
//Nama : Vidia Handayani

#include <iostream>

using namespace std;

int main (void)
{
int a,b;
a = 10;
b = 4;
// a = b;
// b = 7;

cout<< "a = "<< a << endl;
cout<< "b = "<< b << endl;

system ("pause");
return 0;
}

Source Code  Program Operator Unary : 

//Modul 3-2
//Operator Unary
//Nama : Vidia Handayani

#include <iostream>
using namespace std;

int main (void)
{
int e,g;
double f,h;

e = +8;
f = -3.14;

cout << "Nilai e : " << e << endl;
cout << "Nilai f : " << f << endl;

g = -e;
h = -f;

cout << "Nilai g : " << g << endl;
cout << "Nilai h : " << h << endl;

system ("pause");
return 0;
}


Source Code Program Increment :

//Modul 3-3
//Increment
//Nama : Vidia Handayani

#include <iostream>
using namespace std;

int main (void)
{
int i,j;
i = 5;
j = 10;

cout << "Nilai i awal : " << i << endl;
cout << "Nilai ++i  : " << ++i << endl;
cout << "Nilai i akhir: " << i << endl;
cout << "\n";



cout << "Nilai j awal : " << j << endl;
cout << "Nilai --j  : " << --j << endl;
cout << "Nilai j akhir: " << j << endl;
cout << "\n";

system ("pause");
return 0 ;
}

Source Code Program Decrement :

/*InI pROGRAM mODUL 3-4
File : Decrement.cpp
Nama : Vidia Handayani */

#include <iostream>
using namespace std;

int main(void)
{
int k;

float l;
k=100;
l=10.5;

cout<<"Nilai k awal : "<< k <<endl;
cout<<"nilai --k : "<< --k <<endl;
cout<<"nilai k akhir : "<<k <<endl;
cout<< '\n';

cout<<"nilai l awal : "<< l<< endl;
cout<<"nilai l-- : "<<l-- <<endl;
cout << "nilai l akhir : "<<l <<endl;
system("pause");
return 0;
}

Berikut adalah Video Tutorialnya :


Terimakasih sudah menyimak :)




No comments:

Post a Comment