Video Tutorialnya :
Source Code Program Pengulangan While :
/* Modul 6-1
Nama : Vidia Handayani
NIM : 49012072
*/
#include <iostream>
using namespace std;
int main()
{
int pencacah = 1;
while (pencacah <= 10)
{
cout << " D4 - Teknologi Media Digital\n";
pencacah++ ;
}
system ("pause");
return 0;
}
Source Code Program Pengulangan Do While :
/* Modul 6-2.cpp : Defines the entry point for the
console application.
Nama : Vidia Handayani
Nim : 49012072
*/
#include <stdarg.h>
#include <iostream>
using namespace std;
int main(int arg, char* argv[])
{
int pencacah = 1;
do
{
cout << " D4 - Teknologi Media Digital"<< endl;
cout << " Teknik Elektro - ITB"<< endl << endl;
pencacah++ ;
} while (pencacah <= 6);
system ("pause");
return 0;
}
Source Code Pengulangan For :
/* Modul 6-3.cpp : Defines the entry point for the
console application.
Nama : Vidia Handayani
NIM : 49012072
*/
#include <stdarg.h>
#include <iostream>
using namespace std;
int main(int arg, char* 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;
}
system ("pause");
return 0;
}
Source Code Pengulangan For Bersarang :
/*Modul 6-4.cpp : Defines the entry point for the
console application.
Nama : Vidia Handayani
NIM : 49012072
*/
#include <iostream>
using namespace std;
int main(void)
{
for (int j=1; j<=10; j++) {
for (int k=1; k<=j; k++) {
cout << k*j <<"";
}
cout << "\n";
}
system ("pause");
return 0;
}
Selamat belajar :)
No comments:
Post a Comment