SlideShare a Scribd company logo
1 of 11
TUGAS PRAKTIKUKM MICROSOFT VISUAL STUDIO PEMROGRAMAN C++
DENDI RIADI : TEKNIK KOMPUTER KARYAWAN SEMESTER 4
/* =========================================================
Program Pertama microsoft visual studio 2010
Modul 1
Nama : Dendi Riadi
=========================================================*/
#include <iostream> //preprosesor
int main() // fungsi main
{
std::cout << "Ini adalah pertama sayan";
std::cout << "Dengan menggunakan Microsoft Visual Studio C++.n";
return 0;
}
// modul 2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << "ini program kedua saya n";
std::cout << "Menggunakan visual C++." << std::endl;
return 0;
}
//modul 1-3
#include <iostream>
using namespace std;
int main()
{
char tampilkan[1];
char panjang_data[50];
cout << "================================================ n";
cout << " BELAJAR PEMROGRAMAN C++ n";
cout << "================================================ n";
cout << " NAMA : ";
cin.getline (panjang_data,50);
cout << " JURUSAN : Teknik Komputer POLITEKNIK PAJAJARAN " <<endl;
cin.getline(tampilkan,1);
return (0);
}
/* Modul 1.4
Belajar Syntax error
======================================= */
#include <iostream>
using namespace std;
int main()
{
cout << "+++++++++++++++++++++++++++++++++++++++++++ n";
cout << " Memepelajari Syntax errorr n";
cout << "+++++++++++++++++++++++++++++++++++++++++++ n";
cout << " Syntax error adalah kesalahan n";
cout << " Jangan lupa untuk melakukan perintah n";
cout << " Clean Solution yang berada pada n";
cout << " menu Build, sebelum mengkompilasi n";
cout << " program Microsoft Visual Studio C++ n";
return (0);
}
// modul 1-5
// limit.cpp
#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << " TIPE DATA n";
cout << "===============================n";
cout << " minimum char = " << CHAR_MIN << endl;
cout << " maximum char = " << CHAR_MAX << endl;
cout << " minimum signed char = " << SCHAR_MIN << endl;
cout << " maximum signed char = " << SCHAR_MAX << endl;
cout << " maximum unsigned char = " << UCHAR_MAX << endl;
cout << " minimum short = " << SHRT_MIN << endl;
cout << " maximum short = " << SHRT_MAX << endl;
cout << " minimum int = " << INT_MIN << endl;
cout << " maximum int = " << INT_MAX << endl;
cout << " minimum long = " << LONG_MIN << endl;
cout << " maximum long = " << LONG_MAX << endl;
cout << " maximum unsigned short="<<USHRT_MAX<<endl;
cout << " maximum unsigned = " << UINT_MAX << endl;
cout << " maximum unsigned long ="<<ULONG_MAX<<endl;
return (0);
}
// Modul 2-1
// Tipe data dasar.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "============================================== n";
cout << " BELAJAR TIPE DATA n";
cout << "============================================== n";
int X;
X = 10;
cout << "Contoh Nilai Tipe Bilangan Bulat X = "
<< X << endl << endl;
double Y;
Y =123.123;
cout << "Contoh Nilai Tipe 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;
return (0);
}
//Modul 2-2
//Konversi type data
#include <iostream>
using namespace std;
int main()
{
char Karakter = 'D';
cout << "Karakter D = "
<< Karakter
<< endl;
cout << "Nilai ASCII = "
<< (int) Karakter
<< endl;
return (0);
}
// Modul 2-3
// Konstanta
#include <iostream>
using namespace std;
const int MAX = 10;
int main()
{
int A[MAX];
for (int C = 0; C < MAX; C++)
{
A[C] = C * 7;
}
for (int c = 0; c < MAX; c++)
{
cout << A [c] << endl;
}
return (0);
}
// modul 2-4
// variabel global & lokal
#include <iostream>
using namespace std;
int A;
int main()
{
A = 10;
cout << " Nilai variabel A = "
<< A
<< endl
<< endl;
int B;
B = 300;
cout << " Nilai Variabel B = "
<< B
<< endl
<< endl;
return (0);
}
//Modul 3-1
//Operator Assignment
#include <iostream>
using namespace std;
int main()
{
int a,b;
a = 20;
b = 100;
a = b;
b = 7;
cout << "a = ";
cout << a;
cout << endl;
cout << "b = ";
cout << b;
cout << endl;
return (0);
}
// modul 3-2
// operator unary
#include <iostream>
using namespace std;
int main()
{
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;
return (0);
}
// modul 3-3
// increment
#include <iostream>
using namespace std;
int main()
{
int i,j;
i = 5;
cout << "Nilai i awal : " << i << endl;
cout << "Nilai ++i : " << ++i << endl;
cout << "Nilai i akhir : " << i << endl;
cout << 'n';
j = 10;
cout << "Nilai j awal : " << j << endl;
cout << "Nilai ++j : " << ++j << endl;
cout << "Nilai j akhir : " << j << endl;
cout << 'n';
return (0);
}
// modul 3-4
// decrement
#include <iostream>
using namespace std;
int main()
{
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;
return (0);
}
//modul 4-1
//operator aritmatika
#include <iostream>
using namespace std;
int main()
{
cout << "2 + 3 = "
<< 2 + 3
<< endl << endl;
cout << "10 - 5 = "
<< 10 - 5
<< endl << endl;
cout << "4 x 3 = "
<< 4 * 3
<< endl << endl;
cout << "4 / 2 = "
<< 4 / 2
<< endl << endl;
cout << "10 % 3 = "
<< 10 % 3
<< endl << endl;
return (0);
}
// modul 4-2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << " OPERASI OPERATOR LOGIKA n";
cout << "n Tabel Kebenaran operator AND n";
cout << " 1 && 1 = " << (1 && 1) << endl;
cout << " 1 && 0 = " << (1 && 0) << endl;
cout << " 0 && 1 = " << (0 && 1) << endl;
cout << " 0 && 0 = " << (0 && 0) << endl;
cout << "n Tabel Kebenaran operator OR n";
cout << " 1 || 1 = " << (1 || 1) << endl;
cout << " 1 || 0 = " << (1 || 0) << endl;
cout << " 0 || 1 = " << (0 || 1) << endl;
cout << " 0 || 0 = " << (0 || 0) << endl;
cout << "n Tabel Kebenaran operator NOT n";
cout << " !1 = " << !1 << endl;
cout << " !0 = " << !0 << endl << "n";
return (0);
}
// Modul 4-3
// Operator Bitwise
#include <iostream>
using namespace std;
int main()
{
int U, V, W;
U = 1 << 1;
V = 1 << 2;
W = 1 << 3;
cout << "1 << 1 = " << U << endl;
cout << "1 << 2 = " << V << endl;
cout << "2 << 3 = " << W << endl << endl;
int X, Y, Z;
X = 16 >> 1;
Y = 16 >> 2;
Z = 16 >> 3;
cout << "16 >> 1 = " << X << endl;
cout << "16 >> 2 = " << Y << endl;
cout << "16 >> 3 = " << Z << endl << endl;
int A = 1;
int B = 0;
cout << "A = " << A << endl;
cout << "B = " << B << endl;
cout << "!A = " << !A << endl;
cout << "!B = " << !B << endl;
cout << "A & B = " << (A & B) << endl;
cout << "A | B = " << (A | B) << endl;
cout << "A ^ B = " << (A ^ B) << endl << endl;
return 0;
}
// modul 4-4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int X;
cout << "Masukkan Nilai X = ";
cin >> X;
cout << 'n';
X = (X < 0) ? -X : X;
cout << "|X| = " << X;
cout << "n n";
return 0;
}
//project 5-1 : Pencabangan IF
// Nama : Dendi
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Kelulusan Siswa n n";
double Nilai_Ujian;
cout << "Masukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
char Hasil_Ujian[12] = "Tidak Lulus";
if (Nilai_Ujian >= 60)
strcpy (Hasil_Ujian, "Lulus");
cout << "Hasil Ujian : "
<< Hasil_Ujian
<< endl << endl;
return (0);
}
// Project 5-2 : Pencabangan Dua Kondisi (IF_ELSE)
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
cout << "KELULUSAN SISWA n n ";
double Nilai_Ujian;
cout << "Msukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
if (Nilai_Ujian >= 60)
{
cout << ("Hasil Ujian = LULUS")
<< endl << endl;
}
else
{
cout << "Hasil Ujian = TIDAK LULUS"
<< endl << endl;
}
return (0);
}
//modul 5-3 : pencabangan IF bersarang
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
double Nilai_Ujian;
char Indeks;
cout << " KONVERSI NILAI SISWA n n";
cout << " Masukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
if (Nilai_Ujian >= 85){
Indeks = 'A';}
else
if (Nilai_Ujian >= 75){
Indeks = 'B';}
else
if (Nilai_Ujian >= 55){
Indeks = 'C';}
else
if (Nilai_Ujian >= 40){
Indeks = 'D';}
else
{
Indeks = 'E';}
cout << "Indeks Siswa = " << Indeks << endl;
return (0);
}
// Project 5-4 : Pernyataan Switch
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main ()
{
int pilihan;
cout << "Staff pengajar pemrograman C++ :" << endl;
cout << "================================" << endl;
cout << "1. Dr. Ary Setijadi Prihatmanto" << endl;
cout << "2. Dr. Aciek Ida Wuryandarin";
cout << "3. Dr. Pranoto Rusmin";
cout << "n4. Hendrayana, MT" << endl;
cout << "5. Marisa Paryasto, MT" << endl;
cout << "6. Kusprasapta Mutijarsa, MT" << endl;
cout << "7. Syahban Rangkuti, MT" << endl;
cout << "8. Reza Darmakusuma, MT" << endl;
cout << "9. Ferlin Ashadi, MTn";
cout << "10.Amiratusyadiah, MT" << endl << endl;
cout << "Staff pengajar Pemrograman C++ : ";
cin >> pilihan;
cout << endl;
switch (pilihan)
{
case 1:
cout << "Pilihan anda salahn" << endl;
break;
case 2:
cout << "Pilihan anda benarn" << endl;
break;
case 3:
cout << "Pilihan anda salahn" << endl;
break;
case 4:
cout << "Pilihan anda salahn" << endl;
break;
case 5:
cout << "Pilihan anda benarn" << endl;
break;
case 6:
cout << "Pilihan anda salahn" << endl;
break;
case 7:
cout << "Pilihan anda benarn" << endl;
break;
case 8:
cout << "Pilihan anda benarn" << endl;
break;
case 9:
cout << "Pilihan anda salahn" << endl;
break;
case 10:
cout << "Pilihan anda benarn" << endl;
break;
default:
cout << "Pilihan anda tidak ada dalam daftarnn";
}
return (0);
}
// Modul 6-1
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
int pencacah = 1;
do
{
cout << " D4 - Teknologi Media Digital n" ;
pencacah++ ;
}
while (pencacah <= 10);
return (0);
}
// modul 6-2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int pencacah = 1;
do
{
cout << " TEKNIK KOMPUTER & MULTIMEDIA n" << endl;
cout << " POLITEKNIK PAJAJARAN n" << endl << endl;
pencacah++ ;
}
while (pencacah <=6);
return 0;
}
// modul 6-3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "PENGULANGAN MENAIK" << endl;
for (int C=0; C<10; C++){
cout << C+1 << endl;
}
cout << 'n';
cout << "PENGULANGAN MENURUN " << endl;
for (int D=10; D>0; D--){
cout << D << endl;
}
return 0;
}
// modul 6-4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
for (int j=1; j<=10; j++){
for (int k=1; k<=j; k++){
cout << k*j << ' ';
}
cout << 'n';
}
return 0;
}

More Related Content

What's hot

QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
 
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)Stas Rivkin
 
Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Stas Rivkin
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftGiordano Scalzo
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using csnsanth
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso Pérez
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereSergey Platonov
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」matuura_core
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeCory Forsyth
 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architectureJung Kim
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6FITC
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations DVClub
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureOdoo
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a ElixirSvet Ivantchev
 

What's hot (20)

ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
 
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
 
Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in Swift
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using c
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
 
Developing iOS apps with Swift
Developing iOS apps with SwiftDeveloping iOS apps with Swift
Developing iOS apps with Swift
 
Алексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhereАлексей Кутумов, Coroutines everywhere
Алексей Кутумов, Coroutines everywhere
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architecture
 
Useful c programs
Useful c programsUseful c programs
Useful c programs
 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
Web lab programs
Web lab programsWeb lab programs
Web lab programs
 

Viewers also liked

Bracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaBracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaMohamed Mahdy
 
Bahasa Pemrograman C++
Bahasa Pemrograman C++Bahasa Pemrograman C++
Bahasa Pemrograman C++Rangga Ananto
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_htmlSayed Ahmed
 
Proyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadProyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadhestihariani
 
Pemrograman web dengan php my sql
Pemrograman web dengan php my sqlPemrograman web dengan php my sql
Pemrograman web dengan php my sqlHerry Mardiyanto
 
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und EntwicklerWebdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und EntwicklerDaniela Wibbeke
 
Web designp pt
Web designp ptWeb designp pt
Web designp ptBizzyb09
 
Proyek web html menggunakan notepad
Proyek web html menggunakan notepadProyek web html menggunakan notepad
Proyek web html menggunakan notepadSamsuri14
 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Seo_Yun
 
Analisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiAnalisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiDyah Ayu Damayanti
 
Modul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaModul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaDoni Andriansyah
 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Ollie Ollie
 

Viewers also liked (17)

Bracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaBracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social Media
 
Foxpro
FoxproFoxpro
Foxpro
 
Bahasa Pemrograman C++
Bahasa Pemrograman C++Bahasa Pemrograman C++
Bahasa Pemrograman C++
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
 
Proyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadProyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepad
 
Pemrograman web dengan php my sql
Pemrograman web dengan php my sqlPemrograman web dengan php my sql
Pemrograman web dengan php my sql
 
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und EntwicklerWebdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
 
Web designp pt
Web designp ptWeb designp pt
Web designp pt
 
Proyek web html menggunakan notepad
Proyek web html menggunakan notepadProyek web html menggunakan notepad
Proyek web html menggunakan notepad
 
Formularios En Visual Fox Pro
Formularios En Visual Fox ProFormularios En Visual Fox Pro
Formularios En Visual Fox Pro
 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0
 
Analisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiAnalisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasi
 
Visual foxpro
Visual foxproVisual foxpro
Visual foxpro
 
Web design
Web designWeb design
Web design
 
Modul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaModul web design - studi kasus website portal berita
Modul web design - studi kasus website portal berita
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0
 

Similar to Tugas praktikukm pemrograman c++

Similar to Tugas praktikukm pemrograman c++ (20)

ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
 
Project in programming
Project in programmingProject in programming
Project in programming
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 
Ch7 C++
Ch7 C++Ch7 C++
Ch7 C++
 
Oops presentation
Oops presentationOops presentation
Oops presentation
 
Pointers
PointersPointers
Pointers
 
P1
P1P1
P1
 
C++ TUTORIAL 2
C++ TUTORIAL 2C++ TUTORIAL 2
C++ TUTORIAL 2
 
Include
IncludeInclude
Include
 
Algoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.lAlgoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.l
 
Oop lab report
Oop lab reportOop lab report
Oop lab report
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
 
Contoh program c++ kalkulator
Contoh program c++ kalkulatorContoh program c++ kalkulator
Contoh program c++ kalkulator
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Tugas praktikukm pemrograman c++

  • 1. TUGAS PRAKTIKUKM MICROSOFT VISUAL STUDIO PEMROGRAMAN C++ DENDI RIADI : TEKNIK KOMPUTER KARYAWAN SEMESTER 4 /* ========================================================= Program Pertama microsoft visual studio 2010 Modul 1 Nama : Dendi Riadi =========================================================*/ #include <iostream> //preprosesor int main() // fungsi main { std::cout << "Ini adalah pertama sayan"; std::cout << "Dengan menggunakan Microsoft Visual Studio C++.n"; return 0; } // modul 2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> int _tmain(int argc, _TCHAR* argv[]) { std::cout << "ini program kedua saya n"; std::cout << "Menggunakan visual C++." << std::endl; return 0; } //modul 1-3 #include <iostream> using namespace std; int main() { char tampilkan[1]; char panjang_data[50]; cout << "================================================ n"; cout << " BELAJAR PEMROGRAMAN C++ n"; cout << "================================================ n"; cout << " NAMA : "; cin.getline (panjang_data,50); cout << " JURUSAN : Teknik Komputer POLITEKNIK PAJAJARAN " <<endl; cin.getline(tampilkan,1); return (0); } /* Modul 1.4 Belajar Syntax error ======================================= */ #include <iostream> using namespace std; int main()
  • 2. { cout << "+++++++++++++++++++++++++++++++++++++++++++ n"; cout << " Memepelajari Syntax errorr n"; cout << "+++++++++++++++++++++++++++++++++++++++++++ n"; cout << " Syntax error adalah kesalahan n"; cout << " Jangan lupa untuk melakukan perintah n"; cout << " Clean Solution yang berada pada n"; cout << " menu Build, sebelum mengkompilasi n"; cout << " program Microsoft Visual Studio C++ n"; return (0); } // modul 1-5 // limit.cpp #include <iostream> #include <limits> using namespace std; int main() { cout << " TIPE DATA n"; cout << "===============================n"; cout << " minimum char = " << CHAR_MIN << endl; cout << " maximum char = " << CHAR_MAX << endl; cout << " minimum signed char = " << SCHAR_MIN << endl; cout << " maximum signed char = " << SCHAR_MAX << endl; cout << " maximum unsigned char = " << UCHAR_MAX << endl; cout << " minimum short = " << SHRT_MIN << endl; cout << " maximum short = " << SHRT_MAX << endl; cout << " minimum int = " << INT_MIN << endl; cout << " maximum int = " << INT_MAX << endl; cout << " minimum long = " << LONG_MIN << endl; cout << " maximum long = " << LONG_MAX << endl; cout << " maximum unsigned short="<<USHRT_MAX<<endl; cout << " maximum unsigned = " << UINT_MAX << endl; cout << " maximum unsigned long ="<<ULONG_MAX<<endl; return (0); } // Modul 2-1 // Tipe data dasar.cpp #include <iostream> using namespace std; int main() { cout << "============================================== n"; cout << " BELAJAR TIPE DATA n"; cout << "============================================== n"; int X; X = 10; cout << "Contoh Nilai Tipe Bilangan Bulat X = " << X << endl << endl; double Y; Y =123.123; cout << "Contoh Nilai Tipe Bilangan Riil Y = " << Y << endl << endl; char Karakter = 'A';
  • 3. char* Teks = "Kata"; char TEKS[39] = "Teks dengan batas sebanyak 39 karakter"; cout << Karakter << endl; cout << Teks << endl; cout << TEKS << endl << endl; return (0); } //Modul 2-2 //Konversi type data #include <iostream> using namespace std; int main() { char Karakter = 'D'; cout << "Karakter D = " << Karakter << endl; cout << "Nilai ASCII = " << (int) Karakter << endl; return (0); } // Modul 2-3 // Konstanta #include <iostream> using namespace std; const int MAX = 10; int main() { int A[MAX]; for (int C = 0; C < MAX; C++) { A[C] = C * 7; } for (int c = 0; c < MAX; c++) { cout << A [c] << endl; } return (0); } // modul 2-4 // variabel global & lokal #include <iostream> using namespace std; int A; int main() { A = 10;
  • 4. cout << " Nilai variabel A = " << A << endl << endl; int B; B = 300; cout << " Nilai Variabel B = " << B << endl << endl; return (0); } //Modul 3-1 //Operator Assignment #include <iostream> using namespace std; int main() { int a,b; a = 20; b = 100; a = b; b = 7; cout << "a = "; cout << a; cout << endl; cout << "b = "; cout << b; cout << endl; return (0); } // modul 3-2 // operator unary #include <iostream> using namespace std; int main() { 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; return (0);
  • 5. } // modul 3-3 // increment #include <iostream> using namespace std; int main() { int i,j; i = 5; cout << "Nilai i awal : " << i << endl; cout << "Nilai ++i : " << ++i << endl; cout << "Nilai i akhir : " << i << endl; cout << 'n'; j = 10; cout << "Nilai j awal : " << j << endl; cout << "Nilai ++j : " << ++j << endl; cout << "Nilai j akhir : " << j << endl; cout << 'n'; return (0); } // modul 3-4 // decrement #include <iostream> using namespace std; int main() { 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; return (0); } //modul 4-1 //operator aritmatika #include <iostream> using namespace std;
  • 6. int main() { cout << "2 + 3 = " << 2 + 3 << endl << endl; cout << "10 - 5 = " << 10 - 5 << endl << endl; cout << "4 x 3 = " << 4 * 3 << endl << endl; cout << "4 / 2 = " << 4 / 2 << endl << endl; cout << "10 % 3 = " << 10 % 3 << endl << endl; return (0); } // modul 4-2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { std::cout << " OPERASI OPERATOR LOGIKA n"; cout << "n Tabel Kebenaran operator AND n"; cout << " 1 && 1 = " << (1 && 1) << endl; cout << " 1 && 0 = " << (1 && 0) << endl; cout << " 0 && 1 = " << (0 && 1) << endl; cout << " 0 && 0 = " << (0 && 0) << endl; cout << "n Tabel Kebenaran operator OR n"; cout << " 1 || 1 = " << (1 || 1) << endl; cout << " 1 || 0 = " << (1 || 0) << endl; cout << " 0 || 1 = " << (0 || 1) << endl; cout << " 0 || 0 = " << (0 || 0) << endl; cout << "n Tabel Kebenaran operator NOT n"; cout << " !1 = " << !1 << endl; cout << " !0 = " << !0 << endl << "n"; return (0); } // Modul 4-3 // Operator Bitwise #include <iostream> using namespace std; int main() { int U, V, W; U = 1 << 1;
  • 7. V = 1 << 2; W = 1 << 3; cout << "1 << 1 = " << U << endl; cout << "1 << 2 = " << V << endl; cout << "2 << 3 = " << W << endl << endl; int X, Y, Z; X = 16 >> 1; Y = 16 >> 2; Z = 16 >> 3; cout << "16 >> 1 = " << X << endl; cout << "16 >> 2 = " << Y << endl; cout << "16 >> 3 = " << Z << endl << endl; int A = 1; int B = 0; cout << "A = " << A << endl; cout << "B = " << B << endl; cout << "!A = " << !A << endl; cout << "!B = " << !B << endl; cout << "A & B = " << (A & B) << endl; cout << "A | B = " << (A | B) << endl; cout << "A ^ B = " << (A ^ B) << endl << endl; return 0; } // modul 4-4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int X; cout << "Masukkan Nilai X = "; cin >> X; cout << 'n'; X = (X < 0) ? -X : X; cout << "|X| = " << X; cout << "n n"; return 0; } //project 5-1 : Pencabangan IF // Nama : Dendi #include <iostream> #include <string> using namespace std; int main() { cout << "Kelulusan Siswa n n"; double Nilai_Ujian; cout << "Masukkan Nilai Ujian : ";
  • 8. cin >> Nilai_Ujian; cout << endl; char Hasil_Ujian[12] = "Tidak Lulus"; if (Nilai_Ujian >= 60) strcpy (Hasil_Ujian, "Lulus"); cout << "Hasil Ujian : " << Hasil_Ujian << endl << endl; return (0); } // Project 5-2 : Pencabangan Dua Kondisi (IF_ELSE) // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { cout << "KELULUSAN SISWA n n "; double Nilai_Ujian; cout << "Msukkan Nilai Ujian : "; cin >> Nilai_Ujian; cout << endl; if (Nilai_Ujian >= 60) { cout << ("Hasil Ujian = LULUS") << endl << endl; } else { cout << "Hasil Ujian = TIDAK LULUS" << endl << endl; } return (0); } //modul 5-3 : pencabangan IF bersarang // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { double Nilai_Ujian; char Indeks; cout << " KONVERSI NILAI SISWA n n"; cout << " Masukkan Nilai Ujian : "; cin >> Nilai_Ujian; cout << endl; if (Nilai_Ujian >= 85){ Indeks = 'A';} else
  • 9. if (Nilai_Ujian >= 75){ Indeks = 'B';} else if (Nilai_Ujian >= 55){ Indeks = 'C';} else if (Nilai_Ujian >= 40){ Indeks = 'D';} else { Indeks = 'E';} cout << "Indeks Siswa = " << Indeks << endl; return (0); } // Project 5-4 : Pernyataan Switch // Nama : Dendi Riadi #include <iostream> using namespace std; int main () { int pilihan; cout << "Staff pengajar pemrograman C++ :" << endl; cout << "================================" << endl; cout << "1. Dr. Ary Setijadi Prihatmanto" << endl; cout << "2. Dr. Aciek Ida Wuryandarin"; cout << "3. Dr. Pranoto Rusmin"; cout << "n4. Hendrayana, MT" << endl; cout << "5. Marisa Paryasto, MT" << endl; cout << "6. Kusprasapta Mutijarsa, MT" << endl; cout << "7. Syahban Rangkuti, MT" << endl; cout << "8. Reza Darmakusuma, MT" << endl; cout << "9. Ferlin Ashadi, MTn"; cout << "10.Amiratusyadiah, MT" << endl << endl; cout << "Staff pengajar Pemrograman C++ : "; cin >> pilihan; cout << endl; switch (pilihan) { case 1: cout << "Pilihan anda salahn" << endl; break; case 2: cout << "Pilihan anda benarn" << endl; break; case 3: cout << "Pilihan anda salahn" << endl; break; case 4: cout << "Pilihan anda salahn" << endl; break; case 5: cout << "Pilihan anda benarn" << endl; break; case 6: cout << "Pilihan anda salahn" << endl; break; case 7:
  • 10. cout << "Pilihan anda benarn" << endl; break; case 8: cout << "Pilihan anda benarn" << endl; break; case 9: cout << "Pilihan anda salahn" << endl; break; case 10: cout << "Pilihan anda benarn" << endl; break; default: cout << "Pilihan anda tidak ada dalam daftarnn"; } return (0); } // Modul 6-1 // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { int pencacah = 1; do { cout << " D4 - Teknologi Media Digital n" ; pencacah++ ; } while (pencacah <= 10); return (0); } // modul 6-2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int pencacah = 1; do { cout << " TEKNIK KOMPUTER & MULTIMEDIA n" << endl; cout << " POLITEKNIK PAJAJARAN n" << endl << endl; pencacah++ ; } while (pencacah <=6); return 0; } // modul 6-3.cpp : Defines the entry point for the console application. // #include "stdafx.h"
  • 11. #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout << "PENGULANGAN MENAIK" << endl; for (int C=0; C<10; C++){ cout << C+1 << endl; } cout << 'n'; cout << "PENGULANGAN MENURUN " << endl; for (int D=10; D>0; D--){ cout << D << endl; } return 0; } // modul 6-4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { for (int j=1; j<=10; j++){ for (int k=1; k<=j; k++){ cout << k*j << ' '; } cout << 'n'; } return 0; }