Source Code Program TIPE DATA DASAR:
//Modul 2-1
//tipe data dasar.cpp
//Nama : Vidia Handayani
#include <iostream>
using namespace std;
int main()
{
cout << "=========================\n";
cout << " BELAJAR TIPE DATA \n";
cout << "=========================\n\n";
int X;
X = 10;
cout <<"Contoh Nilai Bertipe Bilangan Bulat X = " << X <<endl <<endl;
double Y;
Y = 123.134;
cout <<"Contoh Nilai Bertipe Bilangan Riil Y = " <<Y <<endl <<endl;
char Karakter = 'A';
char* Teks = "Kata";
char TEKS [39] = "Teks dengan batas sebanyak 39 karakter";
cout <<Karakter <<endl;
cout <<Teks <<endl;
cout <<TEKS <<endl <<endl;
system ("pause");
return 0;
}
Source Code KONSTANTA :
//Modul 2-3
//Konstanta
//Nama : Vidia Handayani
#include <iostream>
using namespace std;
const int MAX = 5;
int main()
{
int A[MAX];
for(int C = 0; C < MAX; C++)
{
A[C] = C * 10;
}
for (int c = 0; c < MAX; c++)
{
cout << A [c] << endl;
}
system("pause");
return 0;
}
Source Code VARIABEL :
//Modul 2-4
//Variabel Global & Lokal
//Nama : Vidia Handayani
#include <iostream>
using namespace std;
int A;
int main()
{
A = 100;
cout << " Nilai variabel A = "<< A <<endl <<endl;
int B;
B = 50;
cout << "Nilai Variabel B = "<< B<< endl << endl;
system ("pause");
return 0;
}
Berikut adalah Video Tutorialnya :
Semoga Video Tutorial ini bermanfaat, terima kasih sudah berkunjung :)
No comments:
Post a Comment